diff --git a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java index 14954b3b5dc..27495bcfd9c 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +++ b/driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java @@ -514,6 +514,7 @@ ListenableFuture borrowConnection( int shardId = 0; if (host.getShardingInfo() != null) { + maxQueueSize = host.getShardingInfo().getShardsCount() * maxQueueSize; if (routingKey != null) { Metadata metadata = manager.cluster.getMetadata(); Token t = metadata.newToken(partitioner, routingKey); diff --git a/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java b/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java index 3741ef97ec0..258e3f1647b 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java +++ b/driver-core/src/main/java/com/datastax/driver/core/PoolingOptions.java @@ -462,7 +462,8 @@ public PoolingOptions setPoolTimeoutMillis(int poolTimeoutMillis) { } /** - * Returns the maximum number of requests that get enqueued if no connection is available. + * Returns the maximum number of requests per shard that get enqueued if no connection is + * available. * * @return the maximum queue size. */