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
Ensure nodes and exceptions are serializable
JAVA-2497
Schema metadata is missing when reconnect-on-init is true and there were multiple attempts
JAVA-2464
Throw specific Exception when closing
JAVA-2463
Document how to determine the local DC
JAVA-2460
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
Fix doc link on setPagingState
JAVA-2009
Double-dollar string quote UDF body
JAVA-2008
ReadFailureException error message could include information from failureReasonByEndpoint map
JAVA-1991
Disablegossip Command on one node cant mark it DOWN at client
JAVA-1986
Create a retry policy called LWTRetryPolicy that is more suitable for high-contention LWT workload
JAVA-1981
Document the importance of using specific tinkerpop version with dse-graph module
JAVA-1975
Driver doesnot pickup down node from GOSSIP
JAVA-1974
Allow to clone BoundStatement
JAVA-1961
Consider warning or adjust HashedWheelTimer tickDuration if using Speculative Executions
JAVA-1951
issue 1 of 360

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

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Doc Impact

None

Reviewer

None

Size

None

Priority

Critical
Configure