kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | b179b5053c92c01a948906cb719df0e8060b53150179d40c74993a26bce1f6da |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2014-09-27 19:03 +02:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2014-09-27 19:03 +02:00 |
| Parents | da7a01eee420 |
1 file changed
modified driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +1 −14
| @@ -28,8 +28,6 @@ | ||
| 28 | 28 | import java.util.concurrent.locks.Lock; |
| 29 | 29 | import java.util.concurrent.locks.ReentrantLock; |
| 30 | 30 | |
| 31 | -import com.google.common.util.concurrent.Futures; | |
| 32 | - | |
| 33 | 31 | import com.codahale.metrics.Timer; |
| 34 | 32 | import org.slf4j.Logger; |
| 35 | 33 | import org.slf4j.LoggerFactory; |
| @@ -117,9 +115,6 @@ | ||
| 117 | 115 | } |
| 118 | 116 | |
| 119 | 117 | private boolean query(Host host) { |
| 120 | - // Reset this because we use it later to detect if a failure occurred before or after the request was sent | |
| 121 | - connectionHandler = null; | |
| 122 | - | |
| 123 | 118 | currentPool = manager.pools.get(host); |
| 124 | 119 | if (currentPool == null || currentPool.isClosed()) |
| 125 | 120 | return false; |
| @@ -176,15 +171,7 @@ | ||
| 176 | 171 | // We lock to prevent two retries from launching concurrently |
| 177 | 172 | retryLock.lock(); |
| 178 | 173 | |
| 179 | - // If we have no handler, this means the error that triggered this retry occurred while | |
| 180 | - // sending the query to Cassandra. In that case, the retry might occur synchronously with | |
| 181 | - // the error (see Connection#writeHandler). | |
| 182 | - // But if this error already occurred on a retry, the previous retry is in currentRetry | |
| 183 | - // and is not finished (since it's waiting for this method to complete), but we don't | |
| 184 | - // want to ignore the second retry. | |
| 185 | - boolean isSynchronousRetry = connectionHandler == null; | |
| 186 | - | |
| 187 | - if (currentRetry != null && !currentRetry.isDone() && !isSynchronousRetry) | |
| 174 | + if (currentRetry != null && !currentRetry.isDone()) | |
| 188 | 175 | return; |
| 189 | 176 | |
| 190 | 177 | final Host h = current; |