-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RedisMessengerBridge] Add a delete_after_ack option #36464
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eea6d80
to
262252c
Compare
azjezz
approved these changes
Apr 16, 2020
Should be enough to close #33715. |
chalasr
approved these changes
Apr 16, 2020
chalasr
approved these changes
Apr 16, 2020
fabpot
reviewed
Apr 17, 2020
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 to tests are broken.
… clean up processed messages from memory
262252c
to
7c416a7
Compare
Fixed tests now, seems the failing ones are unrelated. |
fabpot
approved these changes
Apr 17, 2020
Thank you @Seldaek. |
Merged
Does this feature can be backported on 4.4 ? |
@plfort New feature are never backported into already released versions, backported are only bugfixes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows Messenger to clean up processed messages from memory, avoiding a mem "leak" in redis
Right now by default a redis transport for messenger will leak memory as all messages stay in redis forever. You can configure
stream_max_entries
to automatically trim to a max of X entries, but that means if you have big peaks in messages you might start losing messages which have not been processed.This PR provides an alternative to that, by deleting message as they are processed. This is ideal as it avoids having to find the right number for
stream_max_entries
(do you want to risk losing data or use more memory than needed on average?). The only catch is that if you have multiple groups consuming the same stream, the first one processing a message will delete it, so other groups will not see it. For that reasonsetup()
attempts to detect this and fails hard if it is misconfigured to prevent data loss.