Skip to content

Commit

Permalink
Automatically retry requests that failed with RequestNotExecutedExcep…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
ok2c committed Dec 25, 2021
1 parent 7d0ad1a commit af59b04
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.apache.hc.core5.http.HttpResponse;
import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.Method;
import org.apache.hc.core5.http.RequestNotExecutedException;
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.TimeValue;
Expand Down Expand Up @@ -176,6 +177,9 @@ public boolean retryRequest(
if (this.nonRetriableIOExceptionClasses.contains(exception.getClass())) {
return false;
} else {
if (exception instanceof RequestNotExecutedException) {
return true;
}
for (final Class<? extends IOException> rejectException : this.nonRetriableIOExceptionClasses) {
if (rejectException.isInstance(exception)) {
return false;
Expand Down

0 comments on commit af59b04

Please sign in to comment.