Repository navigation
Conversation
Signed-off-by: vmanvs <manvendravsvats@gmail.com>
vmanvs
requested review from
RishabhSaini,
ahg-g,
evacchi,
jtechapps and
shimib
as code owners
November 25, 2026 09:30
Signed-off-by: vmanvs <manvendravsvats@gmail.com>
Contributor
Author
|
Hi @jtechapps, could you take a look at this when you have time, and approve the workflow runs? It follows #522 and fixes #533: in cluster mode the submit pipeline deleted the cancellation marker before the enqueue script, so a go-redis retry of that pipeline could remove a cancel issued between the attempts. The fix drops the delete, since cc: @shimib |
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
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.
What does this PR do?
Removes the
DEL request-cancel:<id>from the pipeline thatenqueueClustersends before the enqueue script. A cancellation marker left by an earlier generation of the ID stays until its TTL expires or a later cancel overwrites it. Standalone and Sentinel go throughsubmitRequestScriptand are unchanged.Why is this change needed?
go-redis retries a pipeline whose reply was lost. If the first attempt ran and
CancelRequestsran before the retry, the marker held this submit's token and the retriedDELremoved it, so the cancelled request was dispatched. The #522 guard cannot cover theDEL, because the marker and the queue are in different slots.The delete is not needed for a resubmitted ID.
IsCancelledtreats a request as cancelled only when the marker equals the request's token, andcleanupRequestStateByIDAndTokendeletes the marker only when it holds the finished request's token. Every submit gets a fresh token, so a stale marker never cancels a later generation.A conditional delete (delete the marker unless it holds this submit's token) also fixes the race in #533, but it still lets an older submit's retry remove a newer generation's cancel: if submit A loses its pipeline reply, and the ID is resubmitted as B and cancelled before A retries, A's retry deletes the marker holding B's token and B is dispatched. Without the delete there is nothing to retry.
How was this tested?
Unit tests added/updated
Integration/e2e tests added/updated
Manual testing performed
In cluster mode, a cancel issued between two attempts of the submit pipeline survives the retry. It fails on main with
ERR no such keyon the marker read.Resubmitting a cancelled ID in cluster mode leaves the old marker holding the old token.
The lost-reply helper takes the write whose reply it drops, following chethanuk#4; the existing callers still drop the enqueue script's reply.
Checklist
git commit -s) per DCOmake test)make lint)Related Issues
Fixes #533
Release note