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
merged 1 commit into from Jul 3, 2019

Conversation

Projects
None yet
3 participants
@themsaid
Copy link
Member

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

Closed

I dont want to retry job #567

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

This comment has been minimized.

Copy link
Member

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
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
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.