Comments (5)
Yes, @oblique did fantastic work to report these errors correctly in #4701 (which got merged as part of #3913 if I remember correctly.
from rust-libp2p.
As an alternative, have a failing OutboundUpgrade not kill the entire connection. Considering that a connection is multiplexed for various protocols, it's not obvious to me why we do this.
Another angle to view this problem is that https://github.com/libp2p/rust-libp2p/blob/3e06e0bca3c2d29bc7fb0e67f880d14a74049483/core/src/upgrade/apply.rs#L230C77-L230C77 shouldn't always return UpgradeError::Apply
. It should take into account that the upgrade_outbound
could also return a UpgradeError::Select
error if the protocol version is V1Lazy
. As far as I've seen, the UpgradeError::Select(Failed)
will be gracefully handled and wouldn't kill the connection.
Maybe this should be the right way of solving this, although I think it warrants some breaking changes
from rust-libp2p.
This is needed because
V1Lazy
will end up killing the entire connection if the protocol is not supported.
That comes as a surprise to me. Can you share details why that is the case?
Can you still reproduce this behavior on the latest release? I would consider the above a bug and suspect it has been fixed since, e.g. via #4701.
from rust-libp2p.
We're not running on the latest release yet, there's work under way for upgrading libp2p in substrate/polkadot.
I digged a bit and discovered that this PR solved the issue of killing connections for a failed outbound stream: #3913. Thanks!
However, there's still an issue. We are now no longer notified of a failed request. We want to be able to handle that (and precisely know why it failed).
Suppose we make a request with V1Lazy
to a peer that doesn't support our req-response protocol. Multistream-select will not do protocol negotiation rightaway, it'll send the request along with the multistream-select packet.
Then, the request OutboundUpgrade
will fail with a generic std::io::Error::custom("Failed")
. This will be ignored by the req-response behaviour (thanks to #3913).
The higher-level code will not be notified of this failure.
I think the root of the problem is that protocol negotiation errors are swallowed when using V1Lazy and converted to a custom IO error that is ignored.
from rust-libp2p.
We are now no longer notified of a failed request
I may be wrong, as I only cherry-picked #3913 over v0.51.3 (which we are using in substrate). Reading the code on latest master, I see we should now report an OutboundFailure
.
By reading the code on master, all of this should be fixed in the latest release, but I cannot test with it, as it's a ton of in-progress work to upgrade libp2p: paritytech/polkadot-sdk#1631.
As a workaround until we manage to upgrade libp2p and test it, I'll switch to using multistream-select V1 for now.
I'll close the issue and reopen it if it's still a problem after upgrading.
It may still be an issue, since it looks like the same symptoms are reported in: paritytech/substrate#14683.
from rust-libp2p.
Related Issues (20)
- Refactor file-sharing example to use tokio instead of async-std
- `Gossipsub`'s substreams keep all connections alive after `idle_connection_timeout`
- mergify continously approving approved pull requests HOT 6
- WebRTC connection doesn't close after timeout HOT 2
- Promote common dependencies to workspace level
- file-sharing works only on local interface HOT 1
- kad: FIND_NODE not conform to specs HOT 9
- Improve request/response documentation HOT 4
- Compilation on docs.rs is failing
- mdns tokio timer panics HOT 2
- Signature verification fails on handshake if 1024 bit RSA key is used HOT 2
- relay: panics due to unimplemented time in wasm HOT 2
- kad: consume `FromSwarm::NewExternalAddrOfPeer` HOT 14
- Reduce `NewExternalAddrCandidate` reports from `identify`
- kad: make `automatic_bootstrap_interval` publicly configurable
- request-response: Inconsistent documentation.
- request-response: Document request/response max sizes HOT 4
- Active streams affect `yamux::connection::rtt` HOT 10
- rendezvous: Example "discovering with identify" doesn't work HOT 4
- kad: make bucket size configurable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-libp2p.