java.util.concurrent.CancellationException: Task was cancelled.

DataStax JIRA | Andy Tolbert | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    User observed the following exception while closing a {{Cluster}} instance: {noformat} [main] ERROR com.datastax.driver.core.Cluster - Unexpected error while marking node UP: while this shouldn't happen, this shouldn't be critical java.util.concurrent.CancellationException: Task was cancelled. at com.google.common.util.concurrent.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:399) at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:313) at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:293) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116) at com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:135) at com.google.common.util.concurrent.Futures$4.run(Futures.java:1138) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135) at com.google.common.util.concurrent.AbstractFuture.cancel(AbstractFuture.java:134) at com.google.common.util.concurrent.Futures$CombinedFuture.setOneValue(Futures.java:1545) at com.google.common.util.concurrent.Futures$CombinedFuture.access$400(Futures.java:1441) at com.google.common.util.concurrent.Futures$CombinedFuture$2.run(Futures.java:1514) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135) at com.google.common.util.concurrent.ListenableFutureTask.done(ListenableFutureTask.java:91) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:380) at java.util.concurrent.FutureTask.cancel(FutureTask.java:177) at com.datastax.driver.core.Cluster$Manager.shutdownNow(Cluster.java:1341) at com.datastax.driver.core.Cluster$Manager.close(Cluster.java:1308) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:1104) at com.datastax.driver.core.Cluster.closeAsync(Cluster.java:449) at com.datastax.driver.core.Cluster.close(Cluster.java:460) at com.datastax.loader.CqlDelimLoad.cleanup(CqlDelimLoad.java:236) at com.datastax.loader.CqlDelimLoad.run(CqlDelimLoad.java:316) at com.datastax.loader.CqlDelimLoad.main(CqlDelimLoad.java:323) {noformat} This error is not logged if an {{InterruptedException}} is encountered, we should also add logic such that if a {{CancellationException}} is thrown it is suppressed as well.

    DataStax JIRA | 2 years ago | Andy Tolbert
    java.util.concurrent.CancellationException: Task was cancelled.
  2. 0

    User observed the following exception while closing a {{Cluster}} instance: {noformat} [main] ERROR com.datastax.driver.core.Cluster - Unexpected error while marking node UP: while this shouldn't happen, this shouldn't be critical java.util.concurrent.CancellationException: Task was cancelled. at com.google.common.util.concurrent.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:399) at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:313) at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:293) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116) at com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:135) at com.google.common.util.concurrent.Futures$4.run(Futures.java:1138) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135) at com.google.common.util.concurrent.AbstractFuture.cancel(AbstractFuture.java:134) at com.google.common.util.concurrent.Futures$CombinedFuture.setOneValue(Futures.java:1545) at com.google.common.util.concurrent.Futures$CombinedFuture.access$400(Futures.java:1441) at com.google.common.util.concurrent.Futures$CombinedFuture$2.run(Futures.java:1514) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150) at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135) at com.google.common.util.concurrent.ListenableFutureTask.done(ListenableFutureTask.java:91) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:380) at java.util.concurrent.FutureTask.cancel(FutureTask.java:177) at com.datastax.driver.core.Cluster$Manager.shutdownNow(Cluster.java:1341) at com.datastax.driver.core.Cluster$Manager.close(Cluster.java:1308) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:1104) at com.datastax.driver.core.Cluster.closeAsync(Cluster.java:449) at com.datastax.driver.core.Cluster.close(Cluster.java:460) at com.datastax.loader.CqlDelimLoad.cleanup(CqlDelimLoad.java:236) at com.datastax.loader.CqlDelimLoad.run(CqlDelimLoad.java:316) at com.datastax.loader.CqlDelimLoad.main(CqlDelimLoad.java:323) {noformat} This error is not logged if an {{InterruptedException}} is encountered, we should also add logic such that if a {{CancellationException}} is thrown it is suppressed as well.

    DataStax JIRA | 2 years ago | Andy Tolbert
    java.util.concurrent.CancellationException: Task was cancelled.

    Root Cause Analysis

    1. java.util.concurrent.CancellationException

      Task was cancelled.

      at com.google.common.util.concurrent.AbstractFuture.cancellationExceptionWithCause()
    2. Guava
      ListenableFutureTask.done
      1. com.google.common.util.concurrent.AbstractFuture.cancellationExceptionWithCause(AbstractFuture.java:399)
      2. com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:313)
      3. com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:293)
      4. com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
      5. com.google.common.util.concurrent.Uninterruptibles.getUninterruptibly(Uninterruptibles.java:135)
      6. com.google.common.util.concurrent.Futures$4.run(Futures.java:1138)
      7. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)
      8. com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150)
      9. com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135)
      10. com.google.common.util.concurrent.AbstractFuture.cancel(AbstractFuture.java:134)
      11. com.google.common.util.concurrent.Futures$CombinedFuture.setOneValue(Futures.java:1545)
      12. com.google.common.util.concurrent.Futures$CombinedFuture.access$400(Futures.java:1441)
      13. com.google.common.util.concurrent.Futures$CombinedFuture$2.run(Futures.java:1514)
      14. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293)
      15. com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:150)
      16. com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:135)
      17. com.google.common.util.concurrent.ListenableFutureTask.done(ListenableFutureTask.java:91)
      17 frames
    3. Java RT
      FutureTask.cancel
      1. java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:380)
      2. java.util.concurrent.FutureTask.cancel(FutureTask.java:177)
      2 frames
    4. DataStax Java Driver for Apache Cassandra - Core
      Cluster.close
      1. com.datastax.driver.core.Cluster$Manager.shutdownNow(Cluster.java:1341)
      2. com.datastax.driver.core.Cluster$Manager.close(Cluster.java:1308)
      3. com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:1104)
      4. com.datastax.driver.core.Cluster.closeAsync(Cluster.java:449)
      5. com.datastax.driver.core.Cluster.close(Cluster.java:460)
      5 frames
    5. com.datastax.loader
      CqlDelimLoad.main
      1. com.datastax.loader.CqlDelimLoad.cleanup(CqlDelimLoad.java:236)
      2. com.datastax.loader.CqlDelimLoad.run(CqlDelimLoad.java:316)
      3. com.datastax.loader.CqlDelimLoad.main(CqlDelimLoad.java:323)
      3 frames