-
Notifications
You must be signed in to change notification settings - Fork 984
HTTPCLIENT-1074: Hard request timeout (requestTimeout) for async & classic clients #710
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
|
@arturobernalg The proposed solution may solve the problem at the cost of using an extra thread per message exchange but the objective of HTTPCLIENT-1074 was completely different. The idea is to keep track of execution time in the normal course of message exchange execution without making use of additional system resources. I am not in favor in merging this change-set in its present state. |
@ok2c Fair enough. I'll apply another approach |
5928561 to
c60396c
Compare
…sic client Clamp pool lease, connect and response timeouts to the remaining budget Add classic call-timeout unit/integration tests and example using modern timeout APIs
c127ec5 to
bcd0946
Compare
@ok2c please another pass |
|
@arturobernalg This change-set attempts to enforce a deadline until receipt of a response head. The idea is to enforce a deadline to the_total_ message exchange including transmission of request and response content entities. Even now the change-set adds a considerable amount of ugliness and this is just a start. I am not sure it is worth it. What is your reason for doing all this? |
@ok2c My intention was to cover the problematic cases (stuck lease / connect / first-byte wait) without extra threads or global schedulers, and to keep the plumbing contained. I'm fine with dropping this approach and close the ticket |
@arturobernalg In my opinion the connection lease / connect / response timeout are good enough for most of real-life scenarios. If we ever find ourselves in a situation where one needs to enforce a deadline over that process we can re-visit this issue What may be quite useful is actually timeout support on per H2 stream basis. You do not need to rush to implement it, just something to keep in mind. If done badly this feature could cause more harm than good. |
Introduce RequestConfig.requestTimeout: an opt-in, end-to-end call deadline that aborts the entire exchange with InterruptedIOException("Request timeout").