kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | c7eb60dba5124e83528bf95fe48921cb919f05e229c77eb1b1275aa3905bc9ca |
|---|---|
| Author | Olivier Michallat <olim7t@users.noreply.github.com> · 2016-10-24 13:30 -07:00 |
| Committer | GitHub <noreply@github.com> · 2016-10-24 13:30 -07:00 |
| Parents | 0a3b17a0cb34 |
2 files changed
modified changelog/README.md +1 −0
| @@ -5,6 +5,7 @@ | ||
| 5 | 5 | - [bug] JAVA-1312: QueryBuilder modifies selected columns when manually selected. |
| 6 | 6 | - [improvement] JAVA-1303: Add missing BoundStatement.setRoutingKey(ByteBuffer...) |
| 7 | 7 | - [improvement] JAVA-262: Make internal executors customizable |
| 8 | +- [bug] JAVA-1320: prevent unnecessary task creation on empty pool | |
| 8 | 9 | |
| 9 | 10 | |
| 10 | 11 | ### 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 | } |