-
Notifications
You must be signed in to change notification settings - Fork 742
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
Do not drop lookups without peers while awaiting events #5839
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good approach to fixing this bug
@mergify queue |
🛑 The pull request has been removed from the queue
|
@mergify refresh |
✅ Pull request refreshed |
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at f187ad8 |
Issue Addressed
Lookups without peers should be allowed to exist for some time. See this common race condition:
In step 4 we could drop the lookup because we attempt to issue a request with no peers available. This has two issues:
drop_lookup_and_children
.Instead, there's no negative for keeping lookups with no peers around for some time. If we regularly prune them, it should not be a memory concern (TODO: maybe yes!).
This PR fixes the race condition seen in first issue of:
Proposed Changes
Do not immediately drop a lookup when attempting to do a download and it has no peers. Instead wait for all the following conditions before dropping it: