-
Notifications
You must be signed in to change notification settings - Fork 112
fix: send cancel when GetBlocks() is cancelled #383
Conversation
@@ -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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really, why do we use these contexts anywhere? We should probably just keep using the session context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don't follow..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I open an issue to discuss?
* refactor: customize SessionInterestManager * refactor: SessionInterestManager perf
* 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
Fixes #253
Fixes ipfs/boxo#124
Depends on #377