downloader: measure successfull deliveries, not failed#17983
Merged
karalabe merged 2 commits intoethereum:masterfrom Nov 7, 2018
Merged
downloader: measure successfull deliveries, not failed#17983karalabe merged 2 commits intoethereum:masterfrom
karalabe merged 2 commits intoethereum:masterfrom
Conversation
karalabe
reviewed
Nov 7, 2018
karalabe
reviewed
Nov 7, 2018
9 tasks
19 tasks
gzliudan
added a commit
to gzliudan/XDPoSChain
that referenced
this pull request
Feb 26, 2025
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.
Sometimes, during fast-sync, there's this behaviour:
Where the number of
duplicateandunexpectedequals the number ofretry:41+167 = 208153+23 = 176180+28 = 208The problem
The likely explanation for this is
Nitems from peerx(at timet0)xis slow in delivering them, or delivers only parts of it. We then get those items delivered from another peer.assignTasks, we now assignxwithNnew items, and request those from him (at timet1)xdelivers the first batch (at timet2). Even though we discard everything asduplicatesandunexpected, we still update his throughut measure: he deliveredNitems in the timet2-t1. While in actual fact, it took himt2-t0to deliver it.This PR changes the measurement to look at how many
successfulldeliveries were made, instead of the total count. A more correct approach would be to look at the correct time for the requests, but that would add a lot more tracking overhead.Consider this a PoC, I haven't tested it extensively yet.