-
Notifications
You must be signed in to change notification settings - Fork 834
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
Expand the set of retryable exceptions in JdkHttpSender #5942
Expand the set of retryable exceptions in JdkHttpSender #5942
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
... and 2 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
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.
lgtm
// received" | ||
// Known retryable HttpTimeoutException messages: "request timed out" | ||
// Known retryable HttpConnectTimeoutException messages: "HTTP connect timed out" | ||
return !(throwable instanceof SSLException); |
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.
should
Lines 102 to 110 in 1ecc919
static boolean isRetryableException(IOException e) { | |
if (!(e instanceof SocketTimeoutException)) { | |
return false; | |
} | |
String message = e.getMessage(); | |
// Connect timeouts can produce SocketTimeoutExceptions with no message, or with "connect timed | |
// out" | |
return message == null || message.toLowerCase(Locale.ROOT).contains("connect timed out"); | |
} |
be also modified?
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.
I'm not sure the behavior of the JDK HttpClient is applicable to OkHttp client. I think in principle we should retry in all the same scenarios for both the JDK HttpClient and OkHttp, but not sure how each failure mode manifests as exceptions in OkHttp.
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.
is there any documented preference for err'ing on the side of at-most-once or at-least-once delivery?
Yes there's this language:
|
@mikelaspina has been running a modified version of JdkHttpSender in production and has found some sharp edges with respect to which exceptions are considered retryable.
This PR expands the set to include all IOExceptions which are not instances of SSLException. Based off his experience running this in prod, all the IOExceptions we ran into qualify as retryable. They're also difficult to identify by their message so this PR opts out of specific exceptions instead of the existing behavior of opting in.