Illustration Image

Cassandra timeout after PT2S

I have the following:

CompletableFuture<> cf = CompletableFuture.allOf(cqlSession.executeAsync(statement)
          .thenApply(AsyncResultSet::wasApplied)
          .toCompletableFuture());

cf.thenApply(s -> Thread.Sleep(60000); //try-catch omitted)
  .get(10, TimeUnit.SECONDS);

Based on datastax' documentation from here, I would've assumed that a Detected a synchronous API... exception would be thrown, but a Cassandra timeout after PT2S is thrown instead. Any idea why this is happening? There's no issue on the writing side as I'm using a Docker container with "ideal" resources (if I remove the Thread.sleep() everything works fine).

While everything that is happening makes sense, it bothers me that a different exception is thrown than the one from the original documentation.

The test is made on a local environment - 1 node, multiple threads.

Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?