FailOnException middleware doesn't work in conjunction with ThrottlesExceptions middleware #56174
Replies: 4 comments
-
Looking through the documentation for |
Beta Was this translation helpful? Give feedback.
-
Would a PR for adding a |
Beta Was this translation helpful? Give feedback.
-
I wonder if the solution isn't to add a check here to see if the job is already failed. + if ($job->job?->isFailed()) {
+ return;
+ }
return $job->release($this->retryAfterMinutes * 60); I don't think I've used this middleware before, so that could be a breaking change from the userland perspective. Not entirely sure. |
Beta Was this translation helpful? Give feedback.
-
I guess that's an option too, although, like you said, that might be a breaking change from a use perspective, as that would change how the Personally, I would prefer a new Of course even with a new |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
12.19.3
PHP Version
8.4.8
Database Driver & Version
No response
Description
Not exactly sure if this should be categorised as a bug, but it is definitely unexpected / unwanted behaviour: the new
FailOnException
job middleware doesn't seem to work as expected in conjunction with theThrottlesExceptions
job middleware. When both are specified as middleware the job seems to be attempted multiple times regardless. I have only tested this out with the "redis" queue driver.Steps To Reproduce
The job below may be used to reproduce the problem. When both middlewares are active the failing job will be re-attempted until throttling kicks in and finally fails on job timeout. When you remove / comment out the
ThrottlesExceptions
middleware things work like expected.Beta Was this translation helpful? Give feedback.
All reactions