Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p2p/discv5: fix removeTicketRef cached ticket removal #15995

Merged
merged 1 commit into from
Jan 30, 2018

Conversation

zsfelfoldi
Copy link
Contributor

This PR fixes an infinite loop in the topic register mechanism at shutdown. #15946 intended to fix a scenario when nextTicketCached was returned while the belonging topic was already removed. The panic was avoided but removeTicketRef should also clear the cached ticket (so that it is not returned again) and this also did not happen when the topic was missing. This PR moves the cache clearing before the missing topic check.
If also sets the log level of "Removing tickets from unknown topic" to Trace because this is a normal and frequently happening scenario during shutdown and we should not regularly print warning messages because of it.

@zsfelfoldi zsfelfoldi requested a review from fjl as a code owner January 30, 2018 15:07
@karalabe karalabe merged commit 6198c53 into ethereum:master Jan 30, 2018
@karalabe karalabe added this to the 1.8.0 milestone Jan 30, 2018
prestonvanloon pushed a commit to prestonvanloon/go-ethereum that referenced this pull request Apr 2, 2018
mariameda pushed a commit to NiluPlatform/go-nilu that referenced this pull request Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants