Skip to content

Commit 5bc688d

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 5bc688d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ 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(
305+
"Initializing connection, reusing old one when toCreate = {}, shardsCount = {}, coreSize = {}, hostDistance = {}",
306+
toCreate,
307+
shardsCount,
308+
coreSize,
309+
hostDistance);
310+
}
311+
303312
this.connections = new List[shardsCount];
304313
scheduledForCreation = new AtomicInteger[shardsCount];
305314
open = new AtomicInteger[shardsCount];

0 commit comments

Comments
 (0)