diff --git a/lib/src/libp2p/connection/established/substream.rs b/lib/src/libp2p/connection/established/substream.rs index 5f3cb5a3e9..27ea009e62 100644 --- a/lib/src/libp2p/connection/established/substream.rs +++ b/lib/src/libp2p/connection/established/substream.rs @@ -1033,10 +1033,12 @@ where } Ok(multistream_select::Negotiation::Success) => {} Ok(multistream_select::Negotiation::NotAvailable) => { - return (Some(SubstreamInner::PingOutFailed { queued_pings }), None) + read_write.wake_up_asap(); + return (Some(SubstreamInner::PingOutFailed { queued_pings }), None); } Err(_) => { - return (Some(SubstreamInner::PingOutFailed { queued_pings }), None) + read_write.wake_up_asap(); + return (Some(SubstreamInner::PingOutFailed { queued_pings }), None); } } } @@ -1078,6 +1080,7 @@ where .pop_front() .map_or(true, |expected| pong != *expected) { + read_write.wake_up_asap(); return (Some(SubstreamInner::PingOutFailed { queued_pings }), None); } if queued_pings.remove(0).is_some() { diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index 0d32cc4a4d..89455e8669 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixed + +- Fix connection being properly killed when the ping substream fails to be negotiated. ([#1459](https://github.com/smol-dot/smoldot/pull/1459)) + ## 2.0.13 - 2023-11-28 ### Changed