-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Labels
Description
To reproduce, create a simple job and call artisan queue listen:
php artisan queue:listen --sleep=5 --timeout=5
If you look in your laravel.log, you'll notice that the spawned queue:work processes are all instantly timing out:
[2014-10-23 16:17:15] dev.ERROR: exception 'Symfony\Component\Process\Exception\ProcessTimedOutException' with message 'The process ""/usr/bin/php5" artisan queue:work --queue="default" --delay=0 --memory=128 --sleep=5 --tries=0 --env=dev" exceeded the timeout of 5 seconds.' in /.../vendor/symfony/process/Symfony/Component/Process/Process.php:1209
Stack trace:
#0 /home/.../vendor/symfony/process/Symfony/Component/Process/Process.php(357): Symfony\Component\Process\Process->checkTimeout()
#1 /home/.../vendor/symfony/process/Symfony/Component/Process/Process.php(206): Symfony\Component\Process\Process->wait()
#2 /home/.../vendor/laravel/framework/src/Illuminate/Queue/Listener.php(94): Symfony\Component\Process\Process->run(Object(Closure))
...
If you change the listen's timeout to 6 seconds, the jobs will run successfully:
php artisan queue:listen --sleep=5 --timeout=6
From my perspective (and after reading the queue docs), it seems like the specified sleep duration should not contribute towards the timeout duration. The listen process should wait seconds before checking if there's a job to run. If there is a job, the job process is spawned and expires in seconds.
This is happening in Laravel 4.2.11.