Skip to content

Commit 3c28cef

Browse files
committed
Log case when toCreate is 0 to investigate reason
We assuming that in some cases toCreate ends up in 0. In order to investigate it we need a plug to log it and show original data.
1 parent 787d8fd commit 3c28cef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ ListenableFuture<Void> initAsyncWithConnection(Connection reusedConnection) {
300300
maxConnections / shardsCount + (maxConnections % shardsCount > 0 ? 1 : 0);
301301
int toCreate = shardsCount * connectionsPerShard;
302302

303+
if (toCreate == 0) {
304+
logger.error("Initializing connection, reusing old one when toCreate = {}, shardsCount = {}, coreSize = {}, hostDistance = {}", toCreate, shardsCount, coreSize, hostDistance);
305+
}
306+
303307
this.connections = new List[shardsCount];
304308
scheduledForCreation = new AtomicInteger[shardsCount];
305309
open = new AtomicInteger[shardsCount];

0 commit comments

Comments
 (0)