-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Test: add setting to change request timeout for rest client #25201
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
The title of the PR mentions changing the request timeout: we have connect timeout, socket timeout and our own max retry timeout to make sure that retries that don't go over a certain timeout. Did you mean to also change the socket timeout here? That may make sense... Also, do you think it is still a good default to have both max retry and socket timeout set to the same value?
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.
Something separate but I wonder if there should be a difference between retry timeout and actual response timeout? Or maybe retry timeout should always be >= socket timeout?
I should have. I'll open a new PR shortly for that. Thanks for catching it.
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.
The difference between socket timeout and max retry is that socket timeout is something set to the http client directly, for each single request. A socket timeout is the timeout when waiting for individual packets, it triggers a timeout whenever no packets come back at all for that many seconds. Max retry is something that we introduced in our own RestClient given that we may retry a request against multiple hosts, to give the guarantee that a request overall (including retries) won't take longer than the set max retry timeout. It can happen that even with a single retry, the socket timeout doesn't trip as something is slowly coming back, but the max retry trips as the request overall is taking too long. Maybe I should have named it differently. And I am not sure whether the same default value is good for both. I am also not sure if we should add validation that max retry is greater or equal than socket timeout.