Bug #102606
closedUpdate Guzzle timeout to 20 seconds
100%
Description
Hello,
I have a scheduler task which requests an API every 15 minutes. As I use TYPO3 RequestFactory the integrated Guzzle client will get its config from TYPO3_CONF_VARS/HTTP. As default in Guzzle options https://docs.guzzlephp.org/en/stable/request-options.html#timeout the property "timeout" is set to 0. The same value is default in TYPO3 as configured in DefaultConfiguration.php.
As TYPO3 is PHP based and works in a web environment we have to respect PHP:max_execution_time which is somewhere between 30 and 240 seconds. With "timeout" 0 (infinite) an outgint request which exceeds max_execution_time will stop the TYPO3 request immediatly. In case of a scheduler task you will see that task is still running which is not the case. The problem is: In that state the task will not be executed again until an integrator reset the task.
For me a default of 0 is a very bad idea.
I prefer setting that value to 20 seconds. If that value has been reached Guzzle will throw an exception which can be catched and the scheduler task can be resetted to a clean state.
Stefan
Updated by Gerrit Code Review 12 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82091
Updated by Gerrit Code Review 12 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82091
Updated by Gerrit Code Review 12 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82025
Updated by Stefan Froemken 12 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f49f871bff426c2913b65eebcc087cf37769fd08.
Updated by Oliver Hader 12 months ago
- Related to Task #102610: Revert "[BUGFIX] Set HTTP timeout to 20 seconds" added
Updated by Gerrit Code Review 12 months ago
- Status changed from Resolved to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82135
Updated by Georg Ringer 6 months ago
- Status changed from Under Review to Needs Feedback
I am not sure if we should close the issue as the change has been abandoned
The change for issue #102606 has the potential to do more harm
than good. The initial intention was to define a HTTP timeout to
be lower than the PHP `max_execution_time`. Defining general
HTTP `timeout` of 20 seconds now also limits e.g. long running
CLI processes - which can be considered a breaking change.
Updated by Georg Ringer 6 months ago
- Status changed from Needs Feedback to Closed
closing confirmed via slack