You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/08/17 19:35:11 UTC

[GitHub] [cassandra] dcapwell commented on a diff in pull request #1796: CASSANDRA-17828: RequestFailure thrown when RequestTimeout should have thrown

dcapwell commented on code in PR #1796:
URL: https://github.com/apache/cassandra/pull/1796#discussion_r948338670


##########
src/java/org/apache/cassandra/service/reads/ReadCallback.java:
##########
@@ -120,6 +120,18 @@ public void awaitResults() throws ReadFailureException, ReadTimeoutException
          */
         int received = resolver.responses.size();
         boolean failed = failures > 0 && (blockFor > received || !resolver.isDataPresent());
+        // If all messages came back as a TIMEOUT then signaled=true and failed=true.
+        // Need to distigues between a timeout and a failure (network, bad data, etc.), so store an extra field timeout
+        // to say that most failures were actually a timeout
+        // see CASSANDRA-17828
+        boolean timedout = false;
+        if (failed)
+        {
+            // is it actually a timeout?
+            long numTimeout = failureReasonByEndpoint.values().stream().filter(RequestFailureReason.TIMEOUT::equals).count();
+            long nonTimeout = failures - numTimeout;
+            timedout = nonTimeout > numTimeout;

Review Comment:
   should write use the same logic?  it would be good to be consistent I guess...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org