Skip to content

Commit 68301b8

Browse files
authored
fix(request-response): Report dial IO errors to the user
This fixes a potential infinite retrying when dialing bad peers. The error is now reported to the user and they should handle it as they see fit for their case. Pull-Request: #5429.
1 parent 2c5a979 commit 68301b8

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ libp2p-pnet = { version = "0.24.0", path = "transports/pnet" }
9999
libp2p-quic = { version = "0.10.3", path = "transports/quic" }
100100
libp2p-relay = { version = "0.17.2", path = "protocols/relay" }
101101
libp2p-rendezvous = { version = "0.14.0", path = "protocols/rendezvous" }
102-
libp2p-request-response = { version = "0.26.2", path = "protocols/request-response" }
102+
libp2p-request-response = { version = "0.26.3", path = "protocols/request-response" }
103103
libp2p-server = { version = "0.12.7", path = "misc/server" }
104104
libp2p-stream = { version = "0.1.0-alpha.1", path = "protocols/stream" }
105105
libp2p-swarm = { version = "0.44.2", path = "swarm" }

protocols/request-response/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.26.3
2+
3+
- Report dial IO errors to the user.
4+
See [PR 5429](https://github.com/libp2p/rust-libp2p/pull/5429).
5+
16
## 0.26.2
27

38
- Deprecate `Behaviour::add_address` in favor of `Swarm::add_peer_address`.

protocols/request-response/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-request-response"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "Generic Request/Response Protocols"
6-
version = "0.26.2"
6+
version = "0.26.3"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"

protocols/request-response/src/handler.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,10 @@ where
236236
}
237237
StreamUpgradeError::Apply(e) => void::unreachable(e),
238238
StreamUpgradeError::Io(e) => {
239-
tracing::debug!(
240-
"outbound stream for request {} failed: {e}, retrying",
241-
message.request_id
242-
);
243-
self.requested_outbound.push_back(message);
239+
self.pending_events.push_back(Event::OutboundStreamFailed {
240+
request_id: message.request_id,
241+
error: e,
242+
});
244243
}
245244
}
246245
}

0 commit comments

Comments
 (0)