While running horizon, jobs seem to post that they have failed :
[2017-12-13 02:14:53] local.ERROR: App\Jobs\Server\SomeJob has been attempted too many times or run too long. The job may have previously timed out. {"exception":"[object] (Illuminate\Queue\MaxAttemptsExceededException(code: 0): App\Jobs\Server\ProvisionServer has been attempted too many times or run too long. The job may have previously timed out. at /Users/LukePOLO/PhpstormProjects/CodePier/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:394)
[stacktrace]
This particular job has a timeout of
public $timeout = 900;
The job will actually complete even though it says it has failed.I initially thought this was a horizon issue but found it to happen with the built in queue too.
Create a job that will exceeds 5 mins , set the $timeout to 900 (15 mins)
It will fail but will successfully complete.
A related issue https://github.com/laravel/horizon/issues/128
The path in your stack trace indicate that you're running Windows. Timeouts aren't available on Windows.
(They also require PHP 7.1 and later.)
This means that there is nothing that terminates the job after 5 minutes. That's why the job succeeds. But other workers will see the job in the queue, note that it took over 5 minutes, and log it as failed after max number of attempts.
That鈥檚 a Mac path , good try though !
Make sure you set the retry_after value correctly.
The path in your stack trace indicate that you're running Windows. Timeouts aren't available on Windows.
(They also require PHP 7.1 and later.)This means that there is nothing that terminates the job after 5 minutes. That's why the job succeeds. But other workers will see the job in the queue, note that it took over 5 minutes, and log it as failed after max number of attempts.
it's been hours that I've been looking for the answer and here is the meaningful one. Thanks!
Is it mentioned in the docs? If not, you could submit a PR for that
Most helpful comment
That鈥檚 a Mac path , good try though !