-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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/discover: slow down lookups on empty table #20389
Conversation
p2p/discover/lookup.go
Outdated
// for the table to fill in this case, but there is no good mechanism for that | ||
// yet. | ||
if len(closest.entries) == 0 { | ||
time.Sleep(1 * time.Second) |
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.
After having sleeped for a whole second, wouldn't it make sense to check it.tab.closest
once more before returning empty?
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.
Since we're now using lookupIterator
exclusively, it'll just come around and trigger another lookup right after one finishes without any result.
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.
1 * time.Second
-> time.Second
?
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.
Minor Q, otherwise LGTM
QQ: Won't this have maybe some adverse effect on hive? No idea, just asking. |
I don't think there will be any effect on hive. |
|
This is a hotfix for an issue where peer discovery would busy-wait in the lookup
iterator when the node is offline for a while.