Elffuss BraidHub

kikocis/java-driver public

Revert "Fix bug in prevention against concurrent retries (JAVA-449)."

This reverts commit 4e3b33cf3e5b83cb39cc53cc9bd53d48b51cfb01.
Changesetb179b5053c92c01a948906cb719df0e8060b53150179d40c74993a26bce1f6da
Authorolim7t <omichallat+github@gmail.com> · 2014-09-27 19:03 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2014-09-27 19:03 +02:00
Parentsda7a01eee420

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/RequestHandler.java +1 −14
@@ -28,8 +28,6 @@
2828 import java.util.concurrent.locks.Lock;
2929 import java.util.concurrent.locks.ReentrantLock;
3030
31-import com.google.common.util.concurrent.Futures;
32-
3331 import com.codahale.metrics.Timer;
3432 import org.slf4j.Logger;
3533 import org.slf4j.LoggerFactory;
@@ -117,9 +115,6 @@
117115 }
118116
119117 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-
123118 currentPool = manager.pools.get(host);
124119 if (currentPool == null || currentPool.isClosed())
125120 return false;
@@ -176,15 +171,7 @@
176171 // We lock to prevent two retries from launching concurrently
177172 retryLock.lock();
178173
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())
188175 return;
189176
190177 final Host h = current;