This repository was archived by the owner on Feb 1, 2023. It is now read-only.
fix: send cancel when GetBlocks() is cancelled#383
Merged
dirkmc merged 5 commits intorefactor/sess-mgr-shutdownfrom May 1, 2020
Merged
fix: send cancel when GetBlocks() is cancelled#383dirkmc merged 5 commits intorefactor/sess-mgr-shutdownfrom
dirkmc merged 5 commits intorefactor/sess-mgr-shutdownfrom
Conversation
Stebalien
suggested changes
Apr 27, 2020
| @@ -130,3 +155,23 @@ func (sm *SessionManager) ReceiveFrom(ctx context.Context, p peer.ID, blks []cid | |||
| // Send CANCEL to all peers with want-have / want-block | |||
| sm.peerManager.SendCancels(ctx, blks) | |||
Member
There was a problem hiding this comment.
Really, why do we use these contexts anywhere? We should probably just keep using the session context.
Contributor
Author
There was a problem hiding this comment.
Sorry I don't follow..
Member
There was a problem hiding this comment.
This was in response to a comment/PR you made about using the global context for canceling, instead of the session context. My point is that we should probably just remove contexts from most of these method signatures.
As a matter of fact, this context is going to be the one we get from ReceiveFrom, which is going to be the context we get from ReceiveMessage, which is going to be the background context.
Contributor
Author
There was a problem hiding this comment.
Should I open an issue to discuss?
Stebalien
approved these changes
Apr 30, 2020
* refactor: customize SessionInterestManager * refactor: SessionInterestManager perf
dirkmc
added a commit
that referenced
this pull request
May 1, 2020
* fix: use one less go-routine per session * fix: send cancel when GetBlocks() is cancelled (#383) * fix: send cancel when GetBlocks() is cancelled * fix: in SessionManager shutdown nil out sessions * fix: sessionWantSender perf * make sessionWantSender.SignalAvailability() non-blocking * Refactor SessionInterestManager (#384) * refactor: customize SessionInterestManager * refactor: SessionInterestManager perf
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.
Fixes #253
Fixes ipfs/boxo#124
Depends on #377