Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: proper differentiate local close and peer un-reachable
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi authored and Yoga07 committed Jun 6, 2021
1 parent 4377a24 commit 655d8a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/routing/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@ impl Comm {
.send_to(&recipient.1, msg_bytes)
.await
.map_err(|err| match err {
qp2p::Error::Connection(qp2p::ConnectionError::LocallyClosed)
| qp2p::Error::Connection(qp2p::ConnectionError::TimedOut) => {
qp2p::Error::Connection(qp2p::ConnectionError::LocallyClosed) => {
Error::ConnectionClosed
}
_ => {
trace!("during sending, received error {:?}", err);
Error::AddressNotReachable { err }
}
_ => Error::ConnectionClosed,
});

(result, recipient.1)
Expand Down
1 change: 0 additions & 1 deletion tests/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use sn_messaging::{Aggregation, DstLocation, Itinerary, SrcLocation};
use sn_routing::{Event, NodeElderChange};

#[tokio::test]
#[ignore]
async fn test_node_drop() -> Result<()> {
// NOTE: create at least 4 nodes, so when one is dropped the remaining ones still form a
// supermajority and the `Offline` proposals reach agreement.
Expand Down

0 comments on commit 655d8a2

Please sign in to comment.