-
Notifications
You must be signed in to change notification settings - Fork 439
[dbal] requeue leads to duplicate entries #814
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
It does seem that early exit a line before should probably be removed. enqueue-dev/pkg/dbal/DbalConsumer.php Lines 99 to 113 in 947eb72
It was superfluous at the moment it was introduced a year ago ( enqueue-dev/pkg/dbal/DbalConsumer.php Lines 124 to 138 in 97159fe
Clearly, it is an error in the library. I'll provide a PR with functional test covering it. |
@adrianrudnik could you check in your local version if you swap the DbalConsumer code with the one in the PR that it behaves how you'd expect? |
@Steveb-p just checked, yes it does, thanks! |
Tests without the change in code:
Tests with changes removing the return.
|
I Just tried to implement a simple JSON submit queue where the endpoint can either respond HTTP status code 200 or fail. For that fail case I wanted to use the requeue option.
Building a very basic approach I always end up with endless new entries in the enqueue table, every retry leading to a new entry. Maybe I'm totally reading the docs wrong:
Interop\Queue\Processor::REQUEUE
defines itself asThe original message is removed from the queue but a copy is published to the queue again.
. Looking at the code this is exact scenario is not reached, as the function returns prior removing the old message.enqueue-dev/pkg/dbal/DbalConsumer.php
Line 112 in 947eb72
In addition to this the
Enqueue\Dbal\DbalProducer::send()
never looks for duplicates and updates them, instead always creating a new entry. This also leads to an infinite loop that fills the database with new entries which are directly processed in the same run.Is this intended behaviour?
The text was updated successfully, but these errors were encountered: