Skip to content

Fix Redis fallback ack_deadline_ms handling by updating message IDs … #118

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 1 commit into
base: main
Choose a base branch
from

Conversation

Soroushsrd
Copy link

Problem

The Redis fallback implementation has an issue where message timeout tracking is based on a message's creation time rather than when it was last received. This results in:

  • Messages possibly being re-queued too soon
  • Duplicate processing of messages
  • Inconsistent ack deadlines

Solution

This PR fixes the issue by:

  1. Breaking down the atomic BRPOPLPUSH operation into separate BRPOP and LPUSH operations
  2. Generating a new ID with the current timestamp when moving messages to the processing queue
  3. Ensuring the ack deadline is measured from when a message is received, not created

Fixes #102

@Soroushsrd Soroushsrd requested a review from a team as a code owner May 9, 2025 00:08
@Soroushsrd Soroushsrd force-pushed the bug_redis_fallback branch from 4987aa5 to 447e183 Compare May 9, 2025 09:24
@Soroushsrd
Copy link
Author

Fixed the linting issue and amended the earlier commit

@svix-jplatte
Copy link
Member

Hey, looks like tests are failing with your change. You can test yourself by running sudo docker compose -f testing-docker-compose.yml up (with -d if you want it to keep running in the background), then cargo test redis_fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Redis fallback ack_deadline_ms does not work as expected
2 participants