-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Retry S3BlobContainer#getRegister
on all exceptions
#114813
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
Retry S3BlobContainer#getRegister
on all exceptions
#114813
Conversation
S3 register reads are subject to the regular client retry policy, but in practice we see failures of these reads sometimes for errors that are transient but for which the SDK does not retry. This commit adds another layer of retries to these reads. Relates ES-9721
Documentation preview: |
Pinging @elastic/es-distributed (Team:Distributed) |
Hi @DaveCTurner, I've created a changelog YAML for you. |
continue; | ||
} catch (InterruptedException interruptedException) { | ||
Thread.currentThread().interrupt(); | ||
finalException.addSuppressed(interruptedException); |
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 we break out of the loop if we're interrupted? I'm guessing something else in the loop will throw an InterruptedException if we continue, but would it be more polite to bail early?
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.
Yeah we do break out here, we fall through to the throw finalException
line here. I added a comment.
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.
Ah yes
} else if (finalException == null) { | ||
finalException = attemptException; | ||
} else if (finalException != attemptException) { | ||
finalException.addSuppressed(attemptException); |
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.
How is it possible that finalException == attemptException
? does something we call throw a singleton exception? I'm not sure I follow this condition.
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.
Who knows what the SDK does or might do in future, but calling addSuppressed
with the same exception throws an IllegalArgumentException
and we don't want that here.
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 with minor comments
S3 register reads are subject to the regular client retry policy, but in practice we see failures of these reads sometimes for errors that are transient but for which the SDK does not retry. This commit adds another layer of retries to these reads. Relates ES-9721
S3 register reads are subject to the regular client retry policy, but in
practice we see failures of these reads sometimes for errors that are
transient but for which the SDK does not retry. This commit adds another
layer of retries to these reads.
Relates ES-9721