Skip to content

fix: Prevent counter corruption from concurrent mark handled in Redis RQ#1878

Open
Mantisus wants to merge 1 commit intoapify:masterfrom
Mantisus:redis-fix-negative-pending
Open

fix: Prevent counter corruption from concurrent mark handled in Redis RQ#1878
Mantisus wants to merge 1 commit intoapify:masterfrom
Mantisus:redis-fix-negative-pending

Conversation

@Mantisus
Copy link
Copy Markdown
Collaborator

@Mantisus Mantisus commented May 6, 2026

Description

  • Fixes counter corruption on concurrent mark_request_as_handled calls for the same request. When two coroutines concurrently called mark_request_as_handled for the same request, both could pass the hexists check before either executed the pipeline, causing counters to be updated multiple times for the same request, breaking the queue operation.

Issues

Testing

  • Added a test to verify that counters are updated correctly during concurrent execution.
  • Added a test to verify that the request is correctly restored to in_progress after failure.

Checklist

  • CI passed

@Mantisus Mantisus self-assigned this May 6, 2026
@Mantisus Mantisus requested review from janbuchar and vdusek May 6, 2026 21:59
@vdusek vdusek changed the title fix: Fix counter corruption on concurrent RedisRequestQueueClient.mark_request_as_handled calls for the same request fix: Prevent counter corruption from concurrent mark handled in Redis RQ May 7, 2026
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.

Negative pending request count when using RedisRequestQueueClient

2 participants