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