p2p/enode: implement per-source timeout in FairMix#25962
Merged
fjl merged 5 commits intoethereum:masterfrom Nov 8, 2022
Merged
p2p/enode: implement per-source timeout in FairMix#25962fjl merged 5 commits intoethereum:masterfrom
fjl merged 5 commits intoethereum:masterfrom
Conversation
Contributor
|
Good catch! Instead of deleting this field, we should really investigate why it isn't used. |
Contributor
Author
Seems it's unused since 1st day? |
Contributor
|
I think what I wanted to do there is, use this source-specific timeout for exponential backoff when one source gets stuck. The part that's missing is actually applying the source specific timeout instead of |
Contributor
Author
OK, added that missing part back. |
fjl
approved these changes
Nov 8, 2022
shekhirin
pushed a commit
to shekhirin/go-ethereum
that referenced
this pull request
Jun 6, 2023
Co-authored-by: Felix Lange <fjl@twurst.com>
nibty
pushed a commit
to FairCrypto/go-ethereum
that referenced
this pull request
Apr 10, 2024
Co-authored-by: Felix Lange <fjl@twurst.com>
This was referenced Feb 19, 2025
anacrolix
pushed a commit
to erigontech/erigon
that referenced
this pull request
Dec 3, 2025
This change fixes an issue where mixSource.timeout was initialized and mutated but never actually used to drive the timer in FairMix.Next. Previously the timer was based on the global m.timeout, so the per-source exponential backoff logic had no effect and the timeout field was effectively dead code. The fix moves timer creation after picking the source and bases it on source.timeout, resetting it to m.timeout on successful reads and halving it on timeouts. This matches the upstream intent (see go-ethereum PR #25962 ethereum/go-ethereum#25962 ) and restores per-source backoff, improving responsiveness when individual sources stall, while preserving the negative-timeout “completely fair” behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.