File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
driver-core/src/main/java/com/datastax/driver/core Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ Merged from 2.1 branch:
109109- [ bug] JAVA-1312: QueryBuilder modifies selected columns when manually selected.
110110- [ improvement] JAVA-1303: Add missing BoundStatement.setRoutingKey(ByteBuffer...)
111111- [ improvement] JAVA-262: Make internal executors customizable
112+ - [ bug] JAVA-1320: prevent unnecessary task creation on empty pool
112113
113114
114115### 3.0.4
Original file line number Diff line number Diff line change @@ -200,11 +200,10 @@ ListenableFuture<Connection> borrowConnection(int maxQueueSize) {
200200 int coreSize = options ().getCoreConnectionsPerHost (hostDistance );
201201 if (coreSize == 0 ) {
202202 maybeSpawnNewConnection ();
203- } else {
203+ } else if ( scheduledForCreation . compareAndSet ( 0 , coreSize )) {
204204 for (int i = 0 ; i < coreSize ; i ++) {
205205 // We don't respect MAX_SIMULTANEOUS_CREATION here because it's only to
206206 // protect against creating connection in excess of core too quickly
207- scheduledForCreation .incrementAndGet ();
208207 manager .blockingExecutor ().submit (newConnectionTask );
209208 }
210209 }
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public ExecutorService createBlockingExecutor(String clusterName) {
9797 2 , 2 ,
9898 DEFAULT_THREAD_KEEP_ALIVE_SECONDS , TimeUnit .SECONDS ,
9999 new LinkedBlockingQueue <Runnable >(),
100- createThreadFactory (clusterName , "worker" ));
100+ createThreadFactory (clusterName , "blocking-task- worker" ));
101101 executor .allowCoreThreadTimeOut (true );
102102 return executor ;
103103 }
You can’t perform that action at this time.
0 commit comments