Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

catching ProcessTimedOutException in Laravel's artisan queue:listen

Tags:

We have a bunch of SQS jobs that we watch for and process using Laravel's php artisan queue:listen.

Periodically, has a few minutes' blip and SQS times out. When this happens, queue:listen aborts with a message like:

[Symfony\Component\Process\Exception\ProcessTimedOutException]                                                                                             
  The process "php artisan queue:work
    --queue="https://sqs.us-west-2.amazonaws.com/*******/queue"
    --delay=0 --memory=128 --sleep=3 --tries=0 -env=production"
  exceeded the timeout of 60 seconds.

I've tried handling the exception in app/start/global.php and alternatively app/start/artisan.php:

App::error(function(Symfony\Component\Process\Exception\ProcessTimedOutException $exception) {
    // do nothing
});

Unfortunately, the exception still occurs and my queue:listen still dies.

How can I catch this exception and ignore it for a retry?

like image 486
ceejayoz Avatar asked Apr 22 '14 20:04

ceejayoz


1 Answers

If it helps, I use SupervisorD for running crons and I have that fire off a queue:work every second, I don't have any issues with SQS then.

like image 190
Michael Brewster Avatar answered Sep 20 '22 22:09

Michael Brewster