ignore task cancelled error in broadcast handler after shut down

This commit is contained in:
woodser 2025-01-08 21:14:40 -05:00
parent e426f4d8f1
commit 1ac4c45f6d

View file

@ -277,9 +277,6 @@ public class BroadcastHandler implements PeerManager.Listener {
@Override @Override
public void onFailure(@NotNull Throwable throwable) { public void onFailure(@NotNull Throwable throwable) {
log.warn("Broadcast to " + connection.getPeersNodeAddressOptional() + " failed. ", throwable);
numOfFailedBroadcasts.incrementAndGet();
if (stopped.get()) { if (stopped.get()) {
return; return;
} }
@ -356,7 +353,8 @@ public class BroadcastHandler implements PeerManager.Listener {
try { try {
future.cancel(true); future.cancel(true);
} catch (Exception e) { } catch (Exception e) {
if (!networkNode.isShutDownStarted()) throw e; if (networkNode.isShutDownStarted()) return; // ignore if shut down
throw e;
} }
}); });
sendMessageFutures.clear(); sendMessageFutures.clear();