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

[11.x] Fixed pop on default Beankstalkd queue when not specifically added #51759

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

rinocs
Copy link
Contributor

@rinocs rinocs commented Jun 10, 2024

This pull request addresses a change in behavior observed when migrating from Laravel 10 to Laravel 11. The pop method in the queue implementation has been enhanced to ensure that it only watches the specified queue and ignores any previously watched queues, effectively restoring the behavior from Laravel 10.

Problem Statement
In Laravel 11, when launching a worker on a specific queue using the artisan command php artisan queue:work --queue=one, the worker listens to both the specified queue (one) and the default queue of Beanstalkd. This results in the worker popping jobs from both queues, which can lead to unintended job processing and potential job loss from queues meant to be handled by separate workers.

@taylorotwell
Copy link
Member

Do you know why this happens on 11? I don't remember any changes here moving from 10 to 11.

@rinocs
Copy link
Contributor Author

rinocs commented Jun 10, 2024

Probably because laravel 10 use the "watchOnly" method https://github.com/laravel/framework/blob/10.x/src/Illuminate/Queue/BeanstalkdQueue.php#L168 instead laravel 11 is using a new version of beanstalkd library and it is not currently available this method

@taylorotwell
Copy link
Member

Looks like tests are failing here.

@taylorotwell taylorotwell marked this pull request as draft June 10, 2024 15:26
@taylorotwell
Copy link
Member

Please mark as ready for review when tests are fixed. 👍

Signed-off-by: Mior Muhammad Zaki <[email protected]>
Signed-off-by: Mior Muhammad Zaki <[email protected]>
@crynobone crynobone changed the title fix: fixed pop on default queue when not specifically added [11.x] Fixed pop on default queue when not specifically added Jun 11, 2024
@crynobone crynobone changed the title [11.x] Fixed pop on default queue when not specifically added [11.x] Fixed pop on default Beankstalkd queue when not specifically added Jun 11, 2024
@crynobone
Copy link
Member

Fixed tests, should be ready for another review.

@crynobone crynobone marked this pull request as ready for review June 11, 2024 09:06
@taylorotwell taylorotwell merged commit da50eea into laravel:11.x Jun 11, 2024
28 checks passed
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.

4 participants