laravel / horizon

Dashboard and code-driven configuration for Laravel queues.
https://laravel.com/docs/horizon
MIT License
3.86k stars 656 forks source link

Timeout not failing job #159

Closed lasselehtinen closed 6 years ago

lasselehtinen commented 7 years ago

I've noticed that the default timeout is 60 seconds. Seems like currently Horizon does fail the job when the timeout is hit like in the traditional queue:work listener. Instead it just seems to hang forever in the queue.

themsaid commented 7 years ago

No it fails normally for me after the timeout passes.

lasselehtinen commented 7 years ago

I've retried this. Created a fresh Laravel app, required horizon and created a following job:

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        sleep(99999);
    }

Seems like it indeed failing the job but it takes a lot longer than expected. With the the timeout of 60 seconds 3 retries, it should take around 3 minutes to fail this job. But in the example below, the job was triggered at 14:31:47 and appeared in the failed queue at 14:39:20. The difference is actually around eight minutes instead of three. Or am I missing something obvious here?

image

image

php artisan horizon:work redis --delay=0 --memory=128 --queue=default --sleep=3 --timeout=60 --tries=3 --supervisor=CPB2189-FkWX:supervisor-1

niclashedam commented 7 years ago

I've seen Horizon behave likewise. Timeout set to 30 seconds, timeout after 20 minutes.

driesvints commented 6 years ago

Closing this issue because it's already solved, old or not relevant anymore. Feel free to reply if you're still experiencing this issue.