Elffuss BraidHub

kikocis/java-driver public

Merge branch '3.0.x' into 3.1.x
Changesetde9155b3c1344e864743967a3468b2b493a45b7e4e89c7ecf600a5b03c6e1c8e
Authorolim7t <omichallat+github@gmail.com> · 2016-10-24 13:32 -07:00
Committerolim7t <omichallat+github@gmail.com> · 2016-10-24 13:32 -07:00
Parentsce76b793024b, 8ed2bc2fb0d2

Browse the files at this changeset

3 files changed

modified changelog/README.md +1 −0
@@ -109,6 +109,7 @@
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
modified driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +1 −2
@@ -200,11 +200,10 @@
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 }
modified driver-core/src/main/java/com/datastax/driver/core/ThreadingOptions.java +1 −1
@@ -97,7 +97,7 @@
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 }