Skip to content

queue:listen's sleep duration contributing towards timeout #6206

@pcorey

Description

@pcorey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions