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

[5.8] Fail job immediately after it timeouts if it wont be retried #29024

merged 1 commit into from Jul 3, 2019


None yet
3 participants
Copy link

commented Jul 2, 2019

Here's the scenario:

  • You have a job with a timeout of 2 seconds, and retries = 1
  • You have your worker's retry_after set to 60 seconds
  1. The job runs, it takes more than 2 seconds so it timeouts and process gets killed.
  2. Jobs isn't marked failed yet.
  3. Worker starts again and after 60 minutes it picks the job again to process.
  4. It finds that this job has no retries left so it marks the job as failed.

So currently a timed out job will wait after the retry_after period to pass before it can be reported as failed even if there are no retries remained.

This PR will fail the job immediately if there are no more retries left, same as when the job throws an exception, we fail it immediately if we won't be retrying it anymore.

@themsaid themsaid referenced this pull request Jul 2, 2019


I dont want to retry job #567

Show resolved Hide resolved src/Illuminate/Queue/Worker.php Outdated

This comment has been minimized.

Copy link

commented Jul 2, 2019

@themsaid can you rebase with 5.8 branch? Build should pass after that.

@themsaid themsaid force-pushed the themsaid:failJobImmediately branch from 9287b23 to c126390 Jul 2, 2019

@taylorotwell taylorotwell merged commit 446b009 into laravel:5.8 Jul 3, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.