Strange error with prepareAsync and executeAsync
JAVA-2314
Timeout too often
JAVA-2292
Deadlock when invalid SolrQuery is sent
JAVA-1563
Abrupt single node failure in a ring due to hardware issue causes clients to timeout even with RF=3
JAVA-1538
Consistency Level auto switch from ONE to LOCAL_ONE
JAVA-1487
Datastax driver consuming lot of cpu and making JVM unresponsive when node(s) are decommissioned
JAVA-1359
Missing support for deletion of several entries from a map column
JAVA-1353
JMETER extension for DSE graph
JAVA-1282
Crushed multi-threading data insert with magic NoHostAvailableException exception
JAVA-1210
Query builder throws CodecNotFoundException for list of UDT
JAVA-2584
Query builder with WHERE clause containing IS NOT NULL throws NPE
JAVA-2583
Add query builder support for indexed list assignments
JAVA-2581
DriverTimeout doesn't retry with idempotent query
JAVA-2574
Exercise new plugin by running a few sample simulations against a cluster to validate changes
JAVA-2565
Gets test specs compiling and passing again
JAVA-2564
Upgrade to 2.x driver and get plugin compiling again
JAVA-2563
Upgrade DSE Gatling plugin to 2.x/unified driver
JAVA-2562
Cql for collection operations generated using QueryBuilder is incompatible with old cassandra versions
JAVA-2555
Reduce size of shaded Guava artifact
JAVA-2540
Store suppressed exceptions in AllNodesFailedException
JAVA-2528
Use unresolved InetAddress if the host names were provided as contact points
JAVA-2519
Throw specific Exception when closing
JAVA-2463
Improve error message when a null value is set as local data center
JAVA-2445
Support for mixed version clusters in Driver 3.x
JAVA-2441
Add automatic-module-names to the manifests
JAVA-2435
Implement getValues() on HdrSnapshot.
JAVA-2425
Support new OPERATION_FAILURE error code
JAVA-2397
Consider extra steps to shield the Driver against system.peers errors
JAVA-2350
Update DbaaS code to use programatic arguments
JAVA-2339
Unregister old metrics when a node gets removed or changes RPC address
JAVA-2331
Document the metrics exposed by the driver
JAVA-2321
Execute return set description is incorrect
JAVA-2305
Create OSGi tests for the new mapper
JAVA-2301
PercentileSpeculativeExecutionPolicy can be marginalized by a single node being unresponsive
JAVA-2299
Add manual section on lightweight transactions
JAVA-2295
Prevent sudden throughput and latency impact from the completion of decommission of node
JAVA-2202
Common Functional Read API for ResultSet and AsyncResultSet
JAVA-2176
Java driver continues to reconnect to a removed node.
JAVA-2163
Consider custom, runtime entity injection/extraction strategies in mapper
JAVA-2126
Consider supporting immutable entity classes in mapper
JAVA-2125
Log a best practice WARN message when batch detected with > 1 unique partition key or large number of statements
JAVA-2104
Allow providing and overriding nowInSeconds via native protocol v5
JAVA-2054
Javadoc Search support (JEP 225)
JAVA-2048
Consider reducing tickDuration in HashedWheelTimer
JAVA-2047
Support Kotlin primary constructor
JAVA-2040
A mechanism to inform users about idempotence when they are using Speculative Execution but not configuring any statements as idempotent
JAVA-2033
Enhance explanation of why DefaultLoadBalancingPolicy does not support DC failover in docs
JAVA-2022
Add configuration example using multiple workloads (Search, Analytics,etc.)
JAVA-2021
Add benchmarks and run them in CI
JAVA-2020
Consider using a different connection when retrying with RetryDecision.RETRY_SAME
JAVA-2016
issue 1 of 384

Strange error with prepareAsync and executeAsync

Description

final Stopwatch watch = Stopwatch.createUnstarted();
final List<CompletableFuture<?>> futures = new ArrayList<CompletableFuture<?>>();

try (CqlSession session = CqlSession.builder().withConfigLoader(DriverConfigLoader.fromClasspath("app.cassandra.conf")).build()) {

watch.reset();
watch.start();

for (int i = 0; i < 10000; i++) {

final int v = i + 1;
final SimpleStatement stmt = SimpleStatement.builder("INSERT INTO some_table (id, value) VALUES (?, ?)").build();

CompletableFuture<AsyncResultSet> f = session.prepareAsync(stmt).toCompletableFuture().thenCompose(p -> { return session.executeAsync(p.bind(1L, v)).toCompletableFuture(); });

futures.add(f);
}

futures.forEach(CompletableFuture::join);

watch.stop();

System.out.println(String.format("Elapsed: %d ms.", watch.elapsed(TimeUnit.MILLISECONDS)));
}

The above code is producing the following exception every time.

java.util.concurrent.CompletionException: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1, use getErrors() for more: /172.31.64.12:9042: com.datastax.oss.driver.api.core.connection.BusyConnectionException: Connection has exceeded its maximum of 1024 simultaneous requests)
at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326)
at java.util.concurrent.CompletableFuture.completeRelay(CompletableFuture.java:338)
at java.util.concurrent.CompletableFuture.uniRelay(CompletableFuture.java:911)
at java.util.concurrent.CompletableFuture$UniRelay.tryFire(CompletableFuture.java:899)
at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.setFinalError(CqlRequestHandler.java:442)
at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.sendRequest(CqlRequestHandler.java:276)
at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler.access$800(CqlRequestHandler.java:95)
at com.datastax.oss.driver.internal.core.cql.CqlRequestHandler$NodeResponseCallback.operationComplete(CqlRequestHandler.java:516)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:485)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)
at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:112)
at io.netty.channel.DefaultChannelPromise.setFailure(DefaultChannelPromise.java:89)
at com.datastax.oss.driver.internal.core.channel.InFlightHandler.write(InFlightHandler.java:124)
at com.datastax.oss.driver.internal.core.channel.InFlightHandler.write(InFlightHandler.java:108)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1026)
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:299)
at com.datastax.oss.driver.internal.core.channel.DefaultWriteCoalescer$Flusher.runOnEventLoop(DefaultWriteCoalescer.java:106)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:495)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.datastax.oss.driver.api.core.AllNodesFailedException: All 1 node(s) tried for the query failed (showing first 1, use getErrors() for more: /172.31.64.12:9042: com.datastax.oss.driver.api.core.connection.BusyConnectionException: Connection has exceeded its maximum of 1024 simultaneous requests)
at com.datastax.oss.driver.api.core.AllNodesFailedException.fromErrors(AllNodesFailedException.java:39)
at com.datastax.oss.driver.api.core.AllNodesFailedException.fromErrors(AllNodesFailedException.java:56)
... 23 more

Environment

Client: Mac OS X AdoptJDK 1.8
Server: CentOS-7

Pull Requests

None

Status

Assignee

Unassigned

Reporter

Debjit Kar

Labels

None

PM Priority

None

Reproduced in

None

Affects versions

None

Fix versions

None

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Critical
Configure