-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] Configure total timeout of request #32765
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
Comments
Hi, that's intended yes: timeout is an idle timeout. Having a transfer timeout could be possible. It's also possible to implement it in userland using the stream function (checking the duration in the foreach loop) Allowing to pass the curl option as-is is no-go on my side: I'd really like the component to not leak the underlying implem. Said another way: we might add a new Up for a PR? |
Ok, I understand, a transfer_timeout option would be great 👍 Sorry I do not have the time to give it a try at the moment. |
I'll have a look at it. |
@nicolas-grekas curl |
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] add "max_duration" option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#32765 | License | MIT | Doc PR | symfony/symfony-docs#12073 Commits ------- a4178f1369 [HttpClient] add "max_duration" option
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] add "max_duration" option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32765 | License | MIT | Doc PR | symfony/symfony-docs#12073 Commits ------- a4178f1 [HttpClient] add "max_duration" option
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] add "max_duration" option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#32765 | License | MIT | Doc PR | symfony/symfony-docs#12073 Commits ------- a4178f1369 [HttpClient] add "max_duration" option
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] add "max_duration" option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#32765 | License | MIT | Doc PR | symfony/symfony-docs#12073 Commits ------- a4178f1369 [HttpClient] add "max_duration" option
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] add "max_duration" option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#32765 | License | MIT | Doc PR | symfony/symfony-docs#12073 Commits ------- a4178f1369 [HttpClient] add "max_duration" option
This PR was merged into the 4.4 branch. Discussion ---------- [HttpClient] add "max_duration" option | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#32765 | License | MIT | Doc PR | symfony/symfony-docs#12073 Commits ------- a4178f1369 [HttpClient] add "max_duration" option
Symfony version(s) affected: 4.3.x
Description
Symfony's HTTP CURL Client supports a
timeout
option that will set the optionCURLOPT_CONNECTTIMEOUT_MS
of curl. This parameter only configures the timeout for the connect phase.But in some use cases (like a crawler f.e) we need to limit the maximum time a request is allowed to take, not only the connect duration. This is what the curl options
CURLOPT_TIMEOUT
andCURLOPT_TIMEOUT_MS
do.Unless I'm wrong, there is no way to configure the curl client with some custom config. Is that really intended? If yes, how can we change this timeout behavior?
How to reproduce
Possible Solution
Either add a way to override curl option or change the timeout behavior of the curl client
The text was updated successfully, but these errors were encountered: