-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger][Doctrine] cleanup only the configured queue_name #54821
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
Comments
Hey, thanks for your report! |
still valid |
Hey, thanks for your report! |
Just a quick reminder to make a comment on this. If I don't hear anything I'll close this. |
Looking at the current master, it must be still the case: symfony/src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php Line 163 in 94f4d7a
|
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
4.4-7.1
Description
Using a master-master mysql replica, a couple of transports with different queue_name-s and separate consumers by transports, it can easily happen that the cleanup statements will result in replication error due to preventable race-conditions.
If we run distinct consumers against the replicated dbs, it should not happen, if the cleanup queries would filter for the queue name. Currently every consumer deletes old records even from unrelated queues.
I know that we could workaround this problem with separate tables, but I think it might be a nice and correct addition for the current implementation.
The current implementation does not filter for the 'queu_name', but it should:
How to reproduce
Possible Solution
Do the cleanup only for the configured queue_name.
In
Symfony\Component\Messenger\Bridge\Doctrine\Transport::get
Additional Context
We experienced this issue with symfony 4.4, but I can see from the code that it still works the same way.
The text was updated successfully, but these errors were encountered: