Skip to content

Commit

Permalink
ignore network node error if shutting down
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jul 5, 2024
1 parent ec9f91e commit 485428e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ public void onDisconnect(CloseConnectionReason closeConnectionReason,
future.exceptionally(throwable -> {
log.debug("onFailure at sendMessage: peersNodeAddress={}\n\tmessage={}\n\tthrowable={}", peersNodeAddress, networkEnvelope.getClass().getSimpleName(), throwable.toString());
UserThread.execute(() -> {
if (!resultFuture.setException(throwable)) {
if (isShutDownStarted) {
resultFuture.cancel(true); // ignore if shutting down
} else if (!resultFuture.setException(throwable)) {
// In case the setException returns false we need to cancel the future.
resultFuture.cancel(true);
}
Expand Down

0 comments on commit 485428e

Please sign in to comment.