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

Protect libp2p connection for handling query protocol. #772

Open
hannahhoward opened this issue Dec 9, 2022 · 1 comment
Open

Protect libp2p connection for handling query protocol. #772

hannahhoward opened this issue Dec 9, 2022 · 1 comment

Comments

@hannahhoward
Copy link
Collaborator

Goals

When making queries on the QueryAsk protocol, we get a number of stream resets while waiting for Query responses, even though the client is protecting its side of the connection.

We may need to protect it on the server side, somewhere in the code path of
https://github.com/filecoin-project/go-fil-markets/blob/master/retrievalmarket/network/libp2p_impl.go#L100
or
https://github.com/filecoin-project/go-fil-markets/blob/master/retrievalmarket/impl/provider.go#L328

This should be a relatively short lived request/response cycle. Is it still reasonable to believe Libp2p might cleanup the connections before the response is sent under some conditions? We are seeing a number of stream reset messages on both sides.

cc: @marten-seemann

@marten-seemann
Copy link
Contributor

It's possible, but unfortunately, there are tons of reasons why streams are reset. You won't believe how many times this has already annoyed me, it's basically a black box at the moment!
It could be the connection manager killing connection (as you correctly note, the probability of this is roughly proportional to the time between a request and a response). It could also be the resource manager killing streams because some limit is exceeded.

Protecting the connection doesn't sound like a crazy idea.

I've recently opened libp2p/specs#479, a proposal to add error codes to stream resets and connection closes. Communicating just a few bits of information would go a long way in helping in situations like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants