Skip to content

Commit b322c4d

Browse files
tolbertamAlexandre Dutra
authored andcommitted
Suppress Unexpected error in onFailure if cancelled (JAVA-710).
1 parent 37db9ed commit b322c4d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • driver-core/src/main/java/com/datastax/driver/core

driver-core/src/main/java/com/datastax/driver/core/Cluster.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ private void onUp(final Host host, Connection reusedConnection) throws Interrupt
15181518
} catch (ExecutionException e) {
15191519
Throwable t = e.getCause();
15201520
// That future is not really supposed to throw unexpected exceptions
1521-
if (!(t instanceof InterruptedException))
1521+
if (!(t instanceof InterruptedException) && !(t instanceof CancellationException))
15221522
logger.error("Unexpected error while marking node UP: while this shouldn't happen, this shouldn't be critical", t);
15231523
}
15241524

@@ -1789,7 +1789,7 @@ private void onAdd(final Host host, Connection reusedConnection) throws Interrup
17891789
} catch (ExecutionException e) {
17901790
Throwable t = e.getCause();
17911791
// That future is not really supposed to throw unexpected exceptions
1792-
if (!(t instanceof InterruptedException))
1792+
if (!(t instanceof InterruptedException) && !(t instanceof CancellationException))
17931793
logger.error("Unexpected error while adding node: while this shouldn't happen, this shouldn't be critical", t);
17941794
}
17951795

0 commit comments

Comments
 (0)