-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Fix Redis Connection::get() after reject() #31387
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
Conversation
@@ -123,7 +123,7 @@ public function ack(string $id): void | |||
} catch (\RedisException $e) { | |||
} | |||
|
|||
if (!$acknowledged || $e) { | |||
if ($e || !$acknowledged) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated: if $e
is not null then $acknowledged
is undefined.
Thank you @chalasr. |
…alasr) This PR was merged into the 4.3-dev branch. Discussion ---------- [Messenger] Fix Redis Connection::get() after reject() | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? |no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a If a message is rejected, another consumer cannot read from the stream because the first subsequent call to `\Redis::xreadgroup()` returns false for some reason. Reproducer: https://github.com/chalasr/redis-transport-bug ping @alexander-schranz Commits ------- c05273f [Messenger] Fix Redis Connection::get() after reject()
@chalasr for me it looks like we need to call on reject |
@alexander-schranz Makes sense, would you mind opening a PR? |
…chranz) This PR was squashed before being merged into the 4.3-dev branch (closes #31396). Discussion ---------- [Messenger] Fix rejecting of pending messages | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... | License | MIT | Doc PR | - As discussed in #31387 (comment). It seems pending messages are not removed by calling xdel so we need to call xack first to remove them from the pending state and then call xdel to remove it from the complete stream. It seems to be the correct way as mentioned in: https://github.com/antirez/redis/issues/5754 Test should be the same as added in: https://github.com/symfony/symfony/pull/31387/files#diff-46c1e03dafbcebc46b5cace7d05de20c Commits ------- 072e466 [Messenger] Fix rejecting of pending messages
If a message is rejected, another consumer cannot read from the stream because the first subsequent call to
\Redis::xreadgroup()
returns false for some reason.Reproducer: https://github.com/chalasr/redis-transport-bug
ping @alexander-schranz