kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | de9155b3c1344e864743967a3468b2b493a45b7e4e89c7ecf600a5b03c6e1c8e |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2016-10-24 13:32 -07:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2016-10-24 13:32 -07:00 |
| Parents | ce76b793024b, 8ed2bc2fb0d2 |
3 files changed
modified changelog/README.md +1 −0
| @@ -109,6 +109,7 @@ | ||
| 109 | 109 | - [bug] JAVA-1312: QueryBuilder modifies selected columns when manually selected. |
| 110 | 110 | - [improvement] JAVA-1303: Add missing BoundStatement.setRoutingKey(ByteBuffer...) |
| 111 | 111 | - [improvement] JAVA-262: Make internal executors customizable |
| 112 | +- [bug] JAVA-1320: prevent unnecessary task creation on empty pool | |
| 112 | 113 | |
| 113 | 114 | |
| 114 | 115 | ### 3.0.4 |
modified driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +1 −2
| @@ -200,11 +200,10 @@ | ||
| 200 | 200 | int coreSize = options().getCoreConnectionsPerHost(hostDistance); |
| 201 | 201 | if (coreSize == 0) { |
| 202 | 202 | maybeSpawnNewConnection(); |
| 203 | - } else { | |
| 203 | + } else if (scheduledForCreation.compareAndSet(0, coreSize)) { | |
| 204 | 204 | for (int i = 0; i < coreSize; i++) { |
| 205 | 205 | // We don't respect MAX_SIMULTANEOUS_CREATION here because it's only to |
| 206 | 206 | // protect against creating connection in excess of core too quickly |
| 207 | - scheduledForCreation.incrementAndGet(); | |
| 208 | 207 | manager.blockingExecutor().submit(newConnectionTask); |
| 209 | 208 | } |
| 210 | 209 | } |
modified driver-core/src/main/java/com/datastax/driver/core/ThreadingOptions.java +1 −1
| @@ -97,7 +97,7 @@ | ||
| 97 | 97 | 2, 2, |
| 98 | 98 | DEFAULT_THREAD_KEEP_ALIVE_SECONDS, TimeUnit.SECONDS, |
| 99 | 99 | new LinkedBlockingQueue<Runnable>(), |
| 100 | - createThreadFactory(clusterName, "worker")); | |
| 100 | + createThreadFactory(clusterName, "blocking-task-worker")); | |
| 101 | 101 | executor.allowCoreThreadTimeOut(true); |
| 102 | 102 | return executor; |
| 103 | 103 | } |