boxo icon indicating copy to clipboard operation
boxo copied to clipboard

[ipfs/go-bitswap] Wantlist Race B

Open Stebalien opened this issue 6 years ago • 7 comments

Forked from: https://github.com/ipfs/go-bitswap/issues/99

Problem

  1. Peer A connects to peer B.
  2. Peer A sends its wantlist to peer B.
  3. Peer A disconnects from peer B.
  4. Peer B notices the disconnect, forgets peer A's wantlist.
  5. Peer A immediately reconnects to peer B.
  6. Peer A notices the disconnect, sees that it still has a connection, doesn't resend it's wantlist.

Solution

The only thing I can think of is the following: whenever the stream we're using to send wantlists closes, we (a) open a new one and (b) send the complete wantlist. Unfortunately, I really wanted to eventually move away from keeping a stream open entirely but, we'll, I can't think of a better solution.

Stebalien avatar Apr 17 '19 05:04 Stebalien