-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add read timeouts to http module #27713
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
Conversation
We currently do not have any server-side read timeouts implemented in elasticsearch. This commit adds a read timeout setting that defaults to 30 seconds. If after 30 seconds a read has not occurred, the channel will be closed. A timeout of value of 0 will disable the timeout.
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. Good catch.
We currently do not have any server-side read timeouts implemented in elasticsearch. This commit adds a read timeout setting that defaults to 30 seconds. If after 30 seconds a read has not occurred, the channel will be closed. A timeout of value of 0 will disable the timeout.
* master: (414 commits) Set ACK timeout on indices service test Implement byte array reusage in `NioTransport` (elastic#27696) [TEST] Remove leftover ES temp directories before Vagrant tests (elastic#27722) Cleanup split strings by comma method Remove unused import from AliasResolveRoutingIT Add read timeouts to http module (elastic#27713) Fix routing with leading or trailing whitespace remove await fix from FullClusterRestartIT.testRecovery Add missing 's' to tmpdir name (elastic#27721) [Issue-27716]: CONTRIBUTING.md IntelliJ configurations settings are confusing. (elastic#27717) [TEST] Now actually wait for merges Test out of order delivery of append only index and retry with an intermediate delete [TEST] remove code duplications in RequestTests [Tests] Add test for GeoShapeFieldType#setStrategyName (elastic#27703) Remove unused *Commit* classes (elastic#27714) Add test for writer operation buffer accounting (elastic#27707) [TEST] Wait for merging to complete before testing breaker Add Open Index API to the high level REST client (elastic#27574) Correcting some minor typos in comments Add unreleased v5.6.6 version ...
* master: Fix index with unknown setting test Remove internal channel tracking in transports (elastic#27711) Improve error msg when a field name contains only white spaces (elastic#27709) Do not open indices with broken settings Set ACK timeout on indices service test Implement byte array reusage in `NioTransport` (elastic#27696) [TEST] Remove leftover ES temp directories before Vagrant tests (elastic#27722) Cleanup split strings by comma method Remove unused import from AliasResolveRoutingIT Add read timeouts to http module (elastic#27713) Fix routing with leading or trailing whitespace remove await fix from FullClusterRestartIT.testRecovery Add missing 's' to tmpdir name (elastic#27721) [Issue-27716]: CONTRIBUTING.md IntelliJ configurations settings are confusing. (elastic#27717) [TEST] Now actually wait for merges
@tbrooks8 Do you know how it plays when it comes to requests that must block until completion? I'm thinking of restoring a snapshot (see #27791) or waiting for the cluster to reach a status etc |
@tlrx My understanding of the netty So if the read completes and it takes longer than the read timeout period for us to write the response back, I think that the read timeout will be triggered. We could change the timeout handler to be |
Thanks for the details @tbrooks8. I do like this change but to be honest I'm a bit worried about the impact it can have for users. I think this change must be clearly documented, the read timeout must be logged using a higher level than TRACE and we must have a bypass or something for all requests that often take more than 30s to be processed. If we don't have all of this I think it would be better to revert this change for now, what do you think? |
@jasontedor thoughts on @tlrx's concern? We can also default the timeout to not enabled. |
Let's set the default to not enabled indeed. |
Elasticsearch offers a number of http requests that can take a while to execute. In elastic#27713 we introduced an http read timeout that defaulted to 30 seconds. This means that if no reads happened for 30 seconds (even after a request is received), the connection would be closed due to timeout. This commit disables the read timeout by default to allow us to evaluate the impact of read timeouts and to avoid introducing distruptive behavior.
Elasticsearch offers a number of http requests that can take a while to execute. In #27713 we introduced an http read timeout that defaulted to 30 seconds. This means that if no reads happened for 30 seconds (even after a request is received), the connection would be closed due to timeout. This commit disables the read timeout by default to allow us to evaluate the impact of read timeouts and to avoid introducing distruptive behavior.
Elasticsearch offers a number of http requests that can take a while to execute. In #27713 we introduced an http read timeout that defaulted to 30 seconds. This means that if no reads happened for 30 seconds (even after a request is received), the connection would be closed due to timeout. This commit disables the read timeout by default to allow us to evaluate the impact of read timeouts and to avoid introducing distruptive behavior.
We currently do not have any server-side read timeouts implemented in
elasticsearch. This commit adds a read timeout setting that defaults to
30 seconds. If after 30 seconds a read has not occurred, the channel
will be closed. A timeout of value of 0 will disable the timeout.