Skip to content

Closing streams and bitswap #5247

@Stebalien

Description

@Stebalien

Bitswap now uses FullClose in SendMessage when sending outbound blocks. Unfortunately, this waits for the other side to send back an EOF (a full round trip). That's terrible.

Unfortunately, there isn't a good solution. The obvious one is to fire off a goroutine to wait for the EOF (we need to wait somewhere) but that's going to suck in terms of memory usage. However, that may be the only reasonable short-term solution.

I'm going to see if I can find a way for the swarm to handle this for us in a constant number of go routines (I may also just create a temporary external "service" until we can figure out the interfaces).


Note: this is causing interop problems with js-ipfs as it doesn't appear to be closing streams in bitswap. See: ipfs/interop#28.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions