fix(bitswap.decision.Engine) send only the freshest messages#601
Merged
Conversation
exchange/bitswap/decision/engine.go
Outdated
Member
There was a problem hiding this comment.
personally, I would make the oneTimeUse be a chan *Envelope just to avoid a dereference, looks cleaner that way IMO
added 2 commits
January 19, 2015 03:07
Before, the engine worker would pop a task and block on send to the bitswap worker even if the bitswap worker wasn't to receive. Since the task could have been invalidated during this blocking send, a small number of stale (already acquired) blocks would be send to partners. Now, tasks are only popped off of the queue when bitswap is ready to send them over the wire. This is accomplished by removing the outboxChanBuffer and implementing a two-phase communication sequence.
8470698 to
5985854
Compare
Member
|
This LGTM, but deferring to @whyrusleeping |
Member
|
This LGTM too. |
btc
pushed a commit
that referenced
this pull request
Jan 20, 2015
…ness fix(bitswap.decision.Engine) send only the freshest messages
Contributor
Author
|
thanks guys |
ariescodescream
pushed a commit
to ariescodescream/go-ipfs
that referenced
this pull request
Oct 23, 2021
* rt refresh refactor
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.
Bitswap prioritizes sending of blocks using a PQ. A decision engine worker
pops tasks off the queue and gives bitswap packaged messages to be sent
to partners.
Before, the engine worker would pop a task and block on send to the
bitswap worker even if the bitswap worker wasn't to receive. Since the
task could have been invalidated during that blocking send, a small
number of stale (already acquired) blocks were sent to partners.
Now, tasks are only popped off of the queue when bitswap is ready to
send them over the wire. This is accomplished by removing the
outboxChanBuffer and implementing a two-phase communication sequence.