-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[HttpClient] cURL: Unable to limit connection timeout #48513
Comments
I'm sorry I don't understand what your expectations are. You set a timeout of 3s in the first example, and it stops after that time. This fulfills your need apparently. |
@nicolas-grekas I will try to clarify my point. The problem here is that Symfony does not have an option to distinguish between "how long do I want to wait before the whole request finishes and I get the complete response" and "how long do I want to wait until the connection to the host is established". Why do we need to distinguish here? Because in case of the host in question not being available, we want to be able to fail fast in order to retry or give immediate feedback to the user. I'll give an example: We know we have to wait up to 10 seconds for a specific request to finish because the requested endpoint needs to do heavy work before being able to respond with a result. So with that expectation we set Symfony's |
I'm sorry but your description doesn't match the behavior nor the definition of timeout & max_duration options. |
Let's close here then. Feel free to reopen. |
Symfony version(s) affected
4.4.x and higher
Description
In #33022 the
CURL_CONNECTTIMEOUT_MS
was removed but it was not added to the allow list ofcurl.extra
again. As such its not possible to set this setting, causing thetimeout
/max_duration
option to be used when connecting to a host that is not available (port not open).See #47246 (comment)
When not being able to distinguish between connection timeout and max duration, it is not possible to set a reasonable timeout in order to let requests fail fast on connection issues and still allow requests to take quite some time to finish overall. Especially in combination with a retry strategy this is a big problem if you do not want to let users wait for a long time when a host is unavailable.
How to reproduce
Possible Solution
Allow setting
CURLOPT_CONNECTTIMEOUT
andCURLOPT_CONNECTTIMEOUT_MS
viacurl.extra
.Additional Context
#33022
#32807
#47246
The text was updated successfully, but these errors were encountered: