-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Jobs in chains ignore ShouldBeUnique
#49263
Comments
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
I've opened #49294 where I've created a test in order to replicate this, but apparently it works as expected. What I've done is I've created a unique job through the @tricki If you have time to provide a clean repository replicating this issue, that would help a ton. Or maybe take a look at my PR and let me know what I can do in order to replicate this. |
Thanks for the response and writing the test! I'll definitely look into it again more closely and report back. I have to say I never really used the queue before, so I'll have to familiarize myself with how they work, especially how the atomic locks work. |
Hi all, is this still being worked on? Seems the test proves this works so this can be closed? |
Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this. |
Laravel Version
10.34.2
PHP Version
8.1.26
Database Driver & Version
mariadb 10.5.8 (Laravel Sail)
Description
When dispatching jobs as part of a chain (using
Bus::chain()
) the uniqueness is not guaranteed.Steps To Reproduce
Illuminate\Contracts\Queue\ShouldBeUnique
interfaceDispatch example:
ShouldBeUnique
: [8.x] Add ability to dispatch unique jobs #35042 (comment)Some details about why I could use this right now (also in case someone can suggest a better way): I have an application that acts as a proxy between two other systems (A and B). System A sends an update request for one, multiple or all entities (e.g. entity 1 has been updated). The application then fetches those changes from System A and saves them to the database. Then the application sends a general "change" request to System B, which will then load and import all entities from the application.
Here's a simple sequence diagram:
In the end I have three jobs that have to be run in sequence:
Additional notes:
ShouldBeUniqueUntilProcessing
, but since that interface extendsShouldQueue
I assume that's not relevant here.I'm hoping this will be implemented. If not, I suggest explicitly mentioning that in the docs.
The text was updated successfully, but these errors were encountered: