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

SkipIfBatchCancelled with retries marks previously failed jobs as successful #48810

Closed
bernardwiesner opened this issue Oct 24, 2023 · 2 comments

Comments

@bernardwiesner
Copy link
Contributor

bernardwiesner commented Oct 24, 2023

Laravel Version

10.4

PHP Version

8.1

Database Driver & Version

No response

Description

When using the SkipIfBatchCancelled middleware together with failed jobs retries, the jobs that previously failed are marked as successful when one job reaches the failed retry threshold.

Steps To Reproduce

Actual:

  1. Batch 10 jobs
  2. Job 3 and 7 fail
  3. Failed jobs are retried up to retry threshold
  4. Job 3 meets threshold first, marks batch as cancelled
  5. Job 7 is skipped, and marked as successful due to SkipIfBatchCancelled middleware

Expected
5. Job 7 had previously failed, so it should not be marked as successful, it should be marked as failed instead.

@crynobone
Copy link
Member

#45869

Based on the initial PR the current behavior seems expected, as it skipped handling the job without failing it. I believe you can create a new custom middleware to handle your requirements and fail the job.

@crynobone
Copy link
Member

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question which may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repository you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

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

2 participants