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
Fix the bug that CLIENT REPLY OFF|SKIP cannot receive push notifications #11875
Fix the bug that CLIENT REPLY OFF|SKIP cannot receive push notifications #11875
Conversation
This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages. In this PR, we clear these flags when sending Pub/Sub messages, and restore them after sending if any. Fixes redis#11874
What about other push notifications? E.g client side tracking. |
I thought about modifying it in something like addReplyPubsubMessage or networking.c. But I can't think of any better way. changing addReply* will cause a huge diff. and I don't want to add extra flags to the client, some flags like, add a flag (PUSHING?) before push, clear the flag after push so in the first place, i chooice this way, and then ignore the other push notifications first. maybe the client flag is the right way? do you have any other ideas? |
but why not put the exact same solution you implemented (backup and restore a flag) in looking at the code now (i was AFK earlier), i see it's insufficient as well. also what i think we wanna do is: |
seems to be yes. i added the PUSHING flag.
Is this the way to do it? (the one i commented) |
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.
LGTM. now maybe add a test or two?
yean, the next step is to add tests, i will try to cover it |
Co-authored-by: Oran Agra <oran@redislabs.com>
…ons (redis#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes redis#11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com> (cherry picked from commit 416842e)
…ons (#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes #11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com> (cherry picked from commit 416842e)
…ons (redis#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes redis#11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com>
…ons (redis#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes redis#11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com> (cherry picked from commit 416842e) (cherry picked from commit f8ae7a4)
…ons (redis#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes redis#11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com> (cherry picked from commit 416842e) (cherry picked from commit f8ae7a4) (cherry picked from commit 96814a32da61e5ed523864e00609a4aa6be065b3)
…ons (#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes #11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com> (cherry picked from commit 416842e) (cherry picked from commit f8ae7a4) (cherry picked from commit 96814a32da61e5ed523864e00609a4aa6be065b3)
…ons (#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes #11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com> (cherry picked from commit 416842e) (cherry picked from commit f8ae7a4)
…ons (redis#11875) This bug seems to be there forever, CLIENT REPLY OFF|SKIP will mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags. With these flags, prepareClientToWrite called by addReply* will return C_ERR directly. So the client can't receive the Pub/Sub messages and any other push notifications, e.g client side tracking. In this PR, we adding a CLIENT_PUSHING flag, disables the reply silencing flags. When adding push replies, set the flag, after the reply, clear the flag. Then add the flag check in prepareClientToWrite. Fixes redis#11874 Note, the SUBSCRIBE command response is a bit awkward, see redis/redis-doc#2327 Co-authored-by: Oran Agra <oran@redislabs.com>
This bug seems to be there forever, CLIENT REPLY OFF|SKIP will
mark the client with CLIENT_REPLY_OFF or CLIENT_REPLY_SKIP flags.
With these flags, prepareClientToWrite called by addReply* will
return C_ERR directly. So the client can't receive the Pub/Sub
messages and any other push notifications, e.g client side tracking.
In this PR, we adding a CLIENT_PUSHING flag, disables the reply
silencing flags. When adding push replies, set the flag, after the reply,
clear the flag. Then add the flag check in prepareClientToWrite.
Fixes #11874
Note, the SUBSCRIBE command response is a bit awkward,
see redis/redis-doc#2327