Skip to content

Commit

Permalink
fix leak ensuring SessionInterestManager is cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Nov 18, 2024
1 parent 2690bfa commit 6cd1ed9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bitswap/client/internal/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func (s *Session) handleReceive(ks []cid.Cid) {

// Inform the SessionInterestManager that this session is no longer
// expecting to receive the wanted keys
s.sim.RemoveSessionWants(s.id, wanted)
s.sim.RemoveSessionInterested(s.id, wanted)

s.idleTick.Stop()

Expand Down

1 comment on commit 6cd1ed9

@gammazero
Copy link
Contributor

@gammazero gammazero commented on 6cd1ed9 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This original code appears incorrect according to the comment in SessionInterestManager:

		// Note that once the block is received the session no longer wants
		// the block, but still wants to receive messages from peers who have
		// the block as they may have other blocks the session is interested in.

Please sign in to comment.