Skip to content
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

Configurability of timeout for default recipes #1256

Closed
rootpd opened this issue Jun 7, 2017 · 8 comments
Closed

Configurability of timeout for default recipes #1256

rootpd opened this issue Jun 7, 2017 · 8 comments
Labels

Comments

@rootpd
Copy link

rootpd commented Jun 7, 2017

Q A
Issue Type Feature Request
Deployer Version N/A
Local Machine OS N/A
Remote Machine OS N/A

Description

My current issue is that when the task runs for more than 300 seconds, it throws an Exception. However my composer install takes longer (due to various reasons that are valid) and I have no possibility to raise the 300 second limit other than editing src/Utility/ProcessRunner.php directly. I'd like to be able to state this within my deploy.php file, preferably for each task separately.

Steps to reproduce

Content of deploy.php

task('deploy', [
    // ...
    'deploy:vendors',
    // ...
]);

Output log

  [Symfony\Component\Process\Exception\ProcessTimedOutException]               
  The process "cd /data/releases/37 &&  /usr/bin/php /data/releases/37/composer.phar install --verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader" exceeded the timeout of 300 seconds.                                    
                                                                               

Exception trace:
 () at /home/deploy-user/app/vendor/symfony/process/Process.php:1332
 Symfony\Component\Process\Process->checkTimeout() at /home/deploy-user/app/vendor/symfony/process/Process.php:421
 Symfony\Component\Process\Process->wait() at /home/deploy-user/app/vendor/symfony/process/Process.php:216
 Symfony\Component\Process\Process->run() at /home/deploy-user/app/vendor/symfony/process/Process.php:242
 Symfony\Component\Process\Process->mustRun() at /home/deploy-user/app/vendor/deployer/deployer/src/Utility/ProcessRunner.php:38
 Deployer\Utility\ProcessRunner->run() at /home/deploy-user/app/vendor/deployer/deployer/src/functions.php:295
 Deployer\run() at /home/deploy-user/app/vendor/deployer/deployer/recipe/deploy/vendors.php:12
 Deployer\Deployer::Deployer\{closure}() at n/a:n/a
 call_user_func() at /home/deploy-user/app/vendor/deployer/deployer/src/Task/Task.php:82
 Deployer\Task\Task->run() at /home/deploy-user/app/vendor/deployer/deployer/src/Executor/SeriesExecutor.php:63
 Deployer\Executor\SeriesExecutor->run() at /home/deploy-user/app/vendor/deployer/deployer/src/Console/TaskCommand.php:135
 Deployer\Console\TaskCommand->execute() at /home/deploy-user/app/vendor/symfony/console/Command/Command.php:264
 Symfony\Component\Console\Command\Command->run() at /home/deploy-user/app/vendor/symfony/console/Application.php:869
 Symfony\Component\Console\Application->doRunCommand() at /home/deploy-user/app/vendor/deployer/deployer/src/Console/Application.php:132
 Deployer\Console\Application->doRunCommand() at /home/deploy-user/app/vendor/symfony/console/Application.php:223
 Symfony\Component\Console\Application->doRun() at /home/deploy-user/app/vendor/symfony/console/Application.php:130
 Symfony\Component\Console\Application->run() at /home/deploy-user/app/vendor/deployer/deployer/src/Deployer.php:315
 Deployer\Deployer::run() at /home/deploy-user/app/vendor/deployer/deployer/bin/dep:120
@antonmedv
Copy link
Member

Yes, it's because of https://github.com/deployphp/deployer/blob/master/src/Utility/ProcessRunner.php#L27
I think as fast solution we can put null there.

@rootpd
Copy link
Author

rootpd commented Jun 7, 2017

I wouldn't hack it with fast solution, the timeout is there for a reason. In worst case scenario I can fork it and have it with a higher limit, until we figure out how to do it properly :). I haven't look at the internals so maybe I will try to come up with some solution.

@antonmedv
Copy link
Member

Maybe create one config option for default timeout:

set('default_timeout', 360);

@vssr
Copy link

vssr commented Jul 11, 2017

+1 Would be great to have this. Currently my Magento 2 deployments can run into problems with lengthy composer install's or bin/magento setup:di:compile, especially on somewhat slower servers. I also expect this to be an issue when handling database back-ups / imports and the like during deployments.

@never615
Copy link

+1

1 similar comment
@jgile
Copy link

jgile commented Jul 23, 2017

+1

@danieldevsquad
Copy link

However, you can override it for a single task like so:

task('npm:run:production', function () {
    run("cd {{release_path}} && {{bin/npm}} run production", [
        'timeout' => 1800,
    ]);
});

@antonmedv
Copy link
Member

Done! Will be in v6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants