Transport level retry#954
Open
l-trotta wants to merge 7 commits into
Open
Conversation
swallez
requested changes
Sep 23, 2025
swallez
left a comment
Contributor
There was a problem hiding this comment.
Left some comments on implementation independence and async tasks.
Adding this to TransportOptions is an interesting choice, as it allows using different retry policies with a single transport.
| import java.util.Iterator; | ||
| import java.util.concurrent.CompletableFuture; | ||
|
|
||
| public class RetryRestClientHttpClient implements TransportHttpClient { |
Contributor
There was a problem hiding this comment.
This class should be co.elastic.transport.http.RetryingHttpClient and be independent from org.elasticsearch.client so that it can be independent of the http client implementation (see also below on exception handling)
8012980 to
2fd0bbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds new retry functionality to the client, configurable like so:
The delegate client (
Rest5Client,RestClientor any custom client) is wrapped in an instance ofRetryingHttpClient, which takes care of the retrying logic according to the configuration.This only concerns the same node the request was originally sent to, it's still the underlying client's responsibility to handle dead node logic and node selection.