contao / manager-bundle

[READ-ONLY] Contao Manager Bundle
GNU Lesser General Public License v3.0
17 stars 10 forks source link

Increase Process timeout or make it configurable #54

Closed fritzmg closed 6 years ago

fritzmg commented 6 years ago

The manager-bundle uses Symfony\Component\Process\Process in ScriptHandler::executeCommand. Its default timeout is 60 seconds. However, in some environments warming the cache can take a long time and thus the execution of this command ends with an exception:

 // Warming up the cache for the prod environment with debug false

Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-update-cmd event terminated with an exception

  [Symfony\Component\Process\Exception\ProcessTimedOutException]
  The process ""php" "…/vendor/contao/manager-bundle/src/Composer/../
  ../bin/contao-console" --ansi cache:warmup --env=prod" exceeded the timeout of 60 seconds.

See also https://community.contao.org/de/showthread.php?68815-gelöst-Contao-Manager-bricht-ab-(Timeout). There are a few more reported instances. They happen especially when the Contao Manager is in use.

fritzmg commented 6 years ago

The contao-manager uses a default timeout of 500 seconds for example for its Symfony\Component\Process\Processes as far as I can see: https://github.com/terminal42/background-process/blob/master/src/Forker/AbstractForker.php#L28

/cc @aschempp

fritzmg commented 6 years ago

This continues to be a problem for us on in some hosting environments. Could the timeout please be increased to 500 in Contao 4.4.15 and 4.5.5?

diegovdev commented 6 years ago

Same issue here when running Contao 4.4 managed edition in a Docker container. I was able to workaround this issue by adding an explicit timeout limit $process->setTimeout(2000); at vendor/contao/manager-bundle/src/Composer/ScriptHandler.php:executeCommand(...) like the image shows below.

I think it would be nice if these processes honor the COMPOSER_PROCESS_TIMEOUT environment variable.

screen shot 2018-02-20 at 7 10 20 pm
leofeyer commented 6 years ago

Fixed in df75e0381fddd3f505e8adb982c5650c8502954c.