Skip to content

redis pubsub: add retries limit and option to disable retries #2803

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

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

magicxyyz
Copy link
Contributor

@magicxyyz magicxyyz commented Nov 22, 2024

Resolves NIT-2815

This PR adds two new redis pubsub consumer configs:

  • retry - enables autoclaim for this consumer, if set to false this consumer will not check messages from PEL (Pending Entries List)
  • max-retry-count - number of message retries after which this consumer will set an error response and Acknowledge the message (-1 = no limit)

Those configs are designed with validator workers in mind.

  • Workers deployed on machines with smaller memory allocation can disable retrying messages that were not successfully processed within idletime-to-autoclaim - in case processing of those messages failed due to OOM.
  • There could be few workers deployed with bigger memory and cpu allocation with retry flag enabled - they will take over messages which processing potentially failed due to OOM.
  • In case max-retry-count is not -1, any consumer with retry flag set will not retry messages already retried more then max-retry-count times, instead it will try to set an error response for the message and acknowledge it as processed.

@magicxyyz magicxyyz force-pushed the pubsub-max-retry-count branch from cf0c3a5 to f8db4cf Compare November 22, 2024 16:38
@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Nov 26, 2024
Base automatically changed from pubsub_Error to master April 3, 2025 15:01
@magicxyyz magicxyyz marked this pull request as ready for review April 11, 2025 20:28
Copy link
Contributor

@ganeshvanahalli ganeshvanahalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Just added a small suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants