-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #257: Retry once in case of AbortedException/IOException #272
Conversation
Codecov Report
@@ Coverage Diff @@
## master #272 +/- ##
===========================================
- Coverage 67.58% 67.5% -0.09%
+ Complexity 1009 1005 -4
===========================================
Files 73 73
Lines 4261 4262 +1
Branches 605 605
===========================================
- Hits 2880 2877 -3
- Misses 1018 1021 +3
- Partials 363 364 +1
Continue to review full report at Codecov.
|
@@ -183,7 +184,8 @@ public boolean test(Throwable throwable) { | |||
redirect(re.location); | |||
return true; | |||
} | |||
if (AbortedException.isConnectionReset(throwable)) { | |||
if (!retried && AbortedException.isConnectionReset(throwable)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
micro optimization: we can invert the condition order to check the volatile only when AbortedException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
When HttpClient receives AbortedException/IOException, it will retry once and then will return the exception so that the user can decide how many retries to do and with what delay.
When HttpClient receives AbortedException/IOException, it will retry once
and then will return the exception so that the user can decide how many
retries to do and with what delay.