Skip to content

Commit

Permalink
fix(tcp): don't attempt to auto-disconnect twice
Browse files Browse the repository at this point in the history
  • Loading branch information
niklaslong committed Nov 30, 2022
1 parent 1975f2d commit 558fcb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion node/tcp/src/protocols/reading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ impl<R: Reading> ReadingInternal for R {
error!(parent: node.span(), "can't read from {}: {}", addr, e);
node.known_peers().register_failure(addr);
if node.config().fatal_io_errors.contains(&e.kind()) {
node.disconnect(addr).await;
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion node/tcp/src/protocols/writing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,13 @@ impl<W: Writing> WritingInternal for W {
let is_fatal = node.config().fatal_io_errors.contains(&e.kind());
let _ = wrapped_msg.delivery_notification.send(Err(e));
if is_fatal {
node.disconnect(addr).await;
break;
}
}
}
}

node.disconnect(addr).await;
});
let _ = rx_writer.await;
conn.tasks.push(writer_task);
Expand Down

0 comments on commit 558fcb4

Please sign in to comment.