Skip to content

Commit

Permalink
ignore task cancelled error in broadcast handler after shut down
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jan 10, 2025
1 parent e426f4d commit 1ac4c45
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ public void onSuccess(Connection connection) {

@Override
public void onFailure(@NotNull Throwable throwable) {
log.warn("Broadcast to " + connection.getPeersNodeAddressOptional() + " failed. ", throwable);
numOfFailedBroadcasts.incrementAndGet();

if (stopped.get()) {
return;
}
Expand Down Expand Up @@ -356,7 +353,8 @@ private void cleanup() {
try {
future.cancel(true);
} catch (Exception e) {
if (!networkNode.isShutDownStarted()) throw e;
if (networkNode.isShutDownStarted()) return; // ignore if shut down
throw e;
}
});
sendMessageFutures.clear();
Expand Down

0 comments on commit 1ac4c45

Please sign in to comment.