Improve timeout handling in remote shards#5495
Merged
Conversation
agourlay
commented
Nov 20, 2024
| /// Used before making a request to the remote shard to avoid useless traffic. | ||
| pub fn check_timeout(timeout: Option<Duration>, operation: &str) -> CollectionResult<()> { | ||
| if timeout.map(|t| t.is_zero()).unwrap_or(false) { | ||
| Err(CollectionError::timeout(0, operation)) |
Member
Author
There was a problem hiding this comment.
we do not have the original timeout so the error is not great for the user here
9 tasks
9 tasks
generall
approved these changes
Nov 22, 2024
timvisee
pushed a commit
that referenced
this pull request
Dec 9, 2024
* Improve timeout handling in remote shards * cleaner impl
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.
Some queries require to perform several I/O action in a sequence before responding to the client.
Between each action, we decrease the timeout in order to track precisely the elapsed time to honor the timeout input from the client.
This logic triggers two different failure modes for the remote shard when:
This PR proposes to:
0.5 secwould become1 secinstead of timing outgRPCconnection timeoutThis gives the following change:
The new approach is more lenient as it gives more time to finish to all requests.