Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Where should I put timeout? #97

Closed
marianvlad opened this issue Aug 17, 2017 · 5 comments
Closed

[Question] Where should I put timeout? #97

marianvlad opened this issue Aug 17, 2017 · 5 comments

Comments

@marianvlad
Copy link

marianvlad commented Aug 17, 2017

I'm using public $timeout = 3600 inside my job and tries => 1 in horizon.php and I got Illuminate\Queue\MaxAttemptsExceededException: A queued job has been attempted too many times. The job may have previously timed out..

[2017-08-18 02:56:48] Processing: App\Jobs\VideosJob
[2017-08-18 02:58:19] Processing: App\Jobs\VideosJob
[2017-08-18 02:58:19] Failed:     App\Jobs\VideosJob
[2017-08-18 03:01:53] Processed:  App\Jobs\VideosJob

The job runs one time until finish like how I want and the process it's not killed. Weird!

With tries => 0 my output is

[2017-08-18 02:45:28] Processing: App\Jobs\VideosJob
[2017-08-18 02:46:59] Processing: App\Jobs\VideosJob
[2017-08-18 02:48:29] Processing: App\Jobs\VideosJob
[2017-08-18 02:50:00] Processing: App\Jobs\VideosJob
[2017-08-18 02:51:04] Processed:  App\Jobs\VideosJob
[2017-08-18 02:51:04] Processed:  App\Jobs\VideosJob
[2017-08-18 02:51:04] Processed:  App\Jobs\VideosJob
[2017-08-18 02:51:05] Processed:  App\Jobs\VideosJob

The job runs four times. 😢

My job fails every 90 seconds even I use public $timeout = 3600 inside job or 'timeout' => 3600 in horizon.php.

@marianvlad marianvlad changed the title [Question] Where shoud I put timeout? [Question] Where should I put timeout? Aug 18, 2017
@marianvlad
Copy link
Author

marianvlad commented Aug 18, 2017

The 90 seconds comes from 'retry_after' => 90 inside queue.php config. I tried to put 300 instead 90 with a timeout of 10 seconds and 2 tries. The job is killed after 10 seconds without any error like A queued job has been attempted too many times. The job may have previously timed out.

@bradleybernard
Copy link

Did you figure this out?

@webpatser
Copy link

You should add "timeout" => 300, to the horizon queue workers environments array

@dmitryuk
Copy link

dmitryuk commented Dec 6, 2017

Should I also set retry_after more that 300 second or not?

@jigarhalani
Copy link

How can I set configuration per job ??
i just want to set $timeout = 172800; for one single job not for all my jobs.

https://stackoverflow.com/questions/63816367/getting-illuminate-queue-maxattemptsexceededexception-in-laravel-jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants