Skip to content

[11.x] Fix integrity constraint violation on failed_jobs_uuid_unique#53264

Merged
taylorotwell merged 13 commits intolaravel:11.xfrom
bytestream:issue-53230
Oct 29, 2024
Merged

[11.x] Fix integrity constraint violation on failed_jobs_uuid_unique#53264
taylorotwell merged 13 commits intolaravel:11.xfrom
bytestream:issue-53230

Conversation

@bytestream
Copy link
Contributor

@bytestream bytestream commented Oct 22, 2024

Fixes #53230

Listeners are bound each time Artisan::call('queue:work') is called. That results in:

  • Job output being duplicated
  • If DatabaseUuidFailedJobProvider is used, then an integrity constraint violation is thrown due to multiple calls to logFailedJob().

Static var prevents listeners being bound multiple times within application life cycle.

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@bytestream bytestream marked this pull request as ready for review October 23, 2024 15:42
@taylorotwell
Copy link
Member

I wonder if this would be more easily solved with just a static variable in the WorkCommand class?

@taylorotwell taylorotwell reopened this Oct 24, 2024
@taylorotwell taylorotwell marked this pull request as draft October 24, 2024 14:57
@bytestream
Copy link
Contributor Author

That's what I did first! I'm happy to have another look at that.

@bytestream bytestream marked this pull request as ready for review October 25, 2024 13:15
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

Successfully merging this pull request may close these issues.

Integrity constraint violation on failed_jobs_uuid_unique

2 participants