This repository was archived by the owner on Feb 1, 2023. It is now read-only.
fix: in message queue only send cancel if want was sent#345
Merged
Conversation
Stebalien
approved these changes
Apr 11, 2020
Member
Stebalien
left a comment
There was a problem hiding this comment.
I have some nits and comments, but they can be addressed later.
| return ks | ||
| } | ||
|
|
||
| // All sessions that want the given keys |
Member
There was a problem hiding this comment.
nit: Should be of the form:
SessionsFor returns all sessions that want the given keys.
(same for the others)
| } | ||
|
|
||
| // Sent moves the want from the pending to the sent list | ||
| func (r *recallWantlist) Sent(e bsmsg.Entry) { |
| // Called when the message has been successfully sent. | ||
| onMessageSent := func(wantlist []bsmsg.Entry) { | ||
| bcst := keysToSet(bcstEntries) | ||
| prws := keysToSet(peerEntries) |
Member
There was a problem hiding this comment.
This is probably going to show up on profiles, but we can wait and see.
Stebalien
reviewed
Apr 11, 2020
| mq.bcstWants.pending.Remove(e.Cid) | ||
| mq.peerWants.pending.RemoveType(e.Cid, e.WantType) | ||
| // Move the keys from pending to sent | ||
| for _, e := range wantlist { |
Member
There was a problem hiding this comment.
I assume we do it this way so we only move things that we actually sent? Given that, we might as well pre-compute that list instead of passing the wantlist back in.
Jorropo
pushed a commit
to Jorropo/go-libipfs
that referenced
this pull request
Jan 26, 2023
fix: in message queue only send cancel if want was sent This commit was moved from ipfs/go-bitswap@6728add
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.