Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing streams and bitswap #5247

Closed
Stebalien opened this issue Jul 17, 2018 · 0 comments · Fixed by #5258
Closed

Closing streams and bitswap #5247

Stebalien opened this issue Jul 17, 2018 · 0 comments · Fixed by #5258
Assignees
Labels
topic/interop Interoperability topic/perf Performance

Comments

@Stebalien
Copy link
Member

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.

@Stebalien Stebalien added topic/interop Interoperability topic/perf Performance labels Jul 17, 2018
Stebalien added a commit that referenced this issue Jul 18, 2018
Otherwise, we tie up the bitswap worker until the other side responds with an EOF.

fixes #5247
related to libp2p/go-libp2p-net#28

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@ghost ghost assigned Stebalien Jul 18, 2018
@ghost ghost added the status/in-progress In progress label Jul 18, 2018
@ghost ghost removed the status/in-progress In progress label Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/interop Interoperability topic/perf Performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant