-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Running queue job picked up by additional workers #54711
Comments
Hey there, Unfortunately we don't support this version of the library anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out. Thanks! |
@nzkozar database queue is not recommended in prod environments anyway. |
I did see this mentioned in a SO thread somewhere, but since I couldn't find any mention of this in Laravel queue documentation, I'd argue this to be a fix worthy bug. |
@nzkozar db can't handle atomic locks properly. Db queue is just for development purposes. A fix could be adding this info in the docs. |
Laravel Version
10.48.28
PHP Version
8.3
Database Driver & Version
MySQL 8.0.35-0ubuntu0.22.04.1 (Ubuntu)
Description
Queue job which starts execution on a worker, will get picked up by a 2nd worker while the 1st worker is still executing it.
I observed this behavior in one of my production projects where queue jobs process media files.
This observed, I believe unwanted behavior, results in the 2nd job pickup to fail the running job which is being executed by the first worker.
Steps To Reproduce
Queue settings:
QUEUE_CONNECTION=database
Dispatch the job on a non-default queue:
TestJob::dispatch()->onQueue('test');
Start queue worker A and wait for it to pick up the dispatched job:
php artisan queue:work --timeout=360 --queue=test
Verify in DB jobs table, that the job is active and running.
Start queue worker B in a new terminal tab and wait for it to pick up the already running job (sometimes it helps to close the new worker and start it again)
php artisan queue:work --timeout=360 --queue=test
The text was updated successfully, but these errors were encountered: