Skip to content

Commit d19159d

Browse files
committed
Merge pull request apache#330 from datastax/java710
Suppress Unexpected error in onFailure if cancelled (JAVA-710).
2 parents 0bef855 + b322c4d commit d19159d

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
@@ -1550,7 +1550,7 @@ private void onUp(final Host host, Connection reusedConnection) throws Interrupt
15501550
} catch (ExecutionException e) {
15511551
Throwable t = e.getCause();
15521552
// That future is not really supposed to throw unexpected exceptions
1553-
if (!(t instanceof InterruptedException))
1553+
if (!(t instanceof InterruptedException) && !(t instanceof CancellationException))
15541554
logger.error("Unexpected error while marking node UP: while this shouldn't happen, this shouldn't be critical", t);
15551555
}
15561556

@@ -1821,7 +1821,7 @@ private void onAdd(final Host host, Connection reusedConnection) throws Interrup
18211821
} catch (ExecutionException e) {
18221822
Throwable t = e.getCause();
18231823
// That future is not really supposed to throw unexpected exceptions
1824-
if (!(t instanceof InterruptedException))
1824+
if (!(t instanceof InterruptedException) && !(t instanceof CancellationException))
18251825
logger.error("Unexpected error while adding node: while this shouldn't happen, this shouldn't be critical", t);
18261826
}
18271827

0 commit comments

Comments
 (0)