-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger][Redis] Worker stops handling messages on first empty message #48166
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
I ran into the same issue as well. Basically Symfony uses
If this command return
|
This is what the nil message look like
|
That is an interesting case. If the message really does not longer exist but returns no content I think its fine to do a @jvmanji Can you create a reproducable test case I think it should be possible inside the |
@alexander-schranz, I added new test and also simple fix. If you'd comment out changes I did in |
…ing messages on first empty message (jvmanji) This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] [Redis] Fixed problem where worker stops handling messages on first empty message | Q | A | ------------- | --- | Branch? |5.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #48166 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | n/a <!-- required for new features --> Fixed problem where worker stops handling messages on first empty message. Commits ------- ce103f1 [Messenger] [Redis] Fixed problem where worker stops handling messages on first empty message
Symfony version(s) affected
5.4, 6.* and probably others
Description
We're using messenger with redis transport in one of our projects. On one of our staging environments, we trimmed one queue (probably in parallel, the consumer of that queue failed). This led us to a strange situation, having a message in
XPENDING
while not having it in the corresponding stream. As only IDs are being stored inXPENDING
, while consuming, messenger can't decode the body. The whole problem is of course our fault and most probably should not happen, anyway the way messenger behaves is weird – it is returning an empty array, like there are no messages in the queue, while notXACK
-ing that message, so it hangs in a strange loop. In my opinion, it should eitherXACK
that message or throw an exception with enough information so that someone using the library can handle it manually. It took us a long time to discover what was going on, while messenger was hung in a strange situation, not consuming messages from the queue – because there are no errors being logged anywhere.How to reproduce
I don't have a quick way to reproduce, but the problem lies in RedisReceiver.php:
In my opinion, when
$redisEnvelope
is null, the library should either throw an exception with message ID or ACK this message, so it won't be handled any more.Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: