kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | ee4de8e6237f41c82a8352a066ee45d1db69845cc066f5ec9d6e74b5f6afe178 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2015-01-29 16:16 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2015-01-30 15:41 +01:00 |
| Parents | 9a38148beb2b |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/HostConnectionPool.java +2 −2
| @@ -260,6 +260,8 @@ | ||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | public void returnConnection(PooledConnection connection) { |
| 263 | + int inFlight = connection.inFlight.decrementAndGet(); | |
| 264 | + | |
| 263 | 265 | if (isClosed()) { |
| 264 | 266 | close(connection); |
| 265 | 267 | return; |
| @@ -271,8 +273,6 @@ | ||
| 271 | 273 | return; |
| 272 | 274 | } |
| 273 | 275 | |
| 274 | - int inFlight = connection.inFlight.decrementAndGet(); | |
| 275 | - | |
| 276 | 276 | if (trash.contains(connection)) { |
| 277 | 277 | if (inFlight == 0 && trash.remove(connection)) |
| 278 | 278 | close(connection); |