Repository navigation
fix(orchestration): redrive lambda misses messages - #1934
Merged
mrgrain merged 1 commit intoSep 22, 2026
Merged
Conversation
cdklabs-automation
enabled auto-merge
September 22, 2026 12:19
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
rix0rrr
disabled auto-merge
September 22, 2026 12:29
rix0rrr
approved these changes
Sep 22, 2026
rix0rrr
left a comment
Collaborator
There was a problem hiding this comment.
Conditionally approved.
I think WaitTimeSeconds should probably be the maximum to minimize the chances of race conditions. It's prooooooooobably fine with 3, but we also don't really have latency requirements so why not minimize them.
Contributor
Author
|
As discussed, there's no maximum wait time. It just needs to be lower than http configuration (which can be adjusted as well if needed). |
mrgrain
deleted the
mrgrain/fix/orchestration/redrive-lambda-visibility-timeout
branch
September 22, 2026 12:37
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.
The
RedriveStateMachinelambda drains the backend DLQ by looping onReceiveMessageCommanduntil it gets an empty response. It previously calledReceiveMessageCommandwith noWaitTimeSeconds, which defaults to0. SQS calls this short polling.During failure recovery, I have observed that the Redrive-Lambda sometimes doesn't drain all messages. This fits with SQS's description of short polling, although I am not entirely sure how exactly. But because the loop exits as soon as
result.Messagesis empty, a single short-polled empty response ends the redrive early, leaving messages in the DLQ unprocessed.Adding
WaitTimeSeconds: 3switches to long-polling: SQS waits up to 3s and samples more of the backend before responding, making an early empty result far less likely. Again, I have observed that this resolves the issue and all messages are now drained from the queue.The PR also lowers
VisibilityTimeoutfrom 900s to 60s. The message is only deleted after a successfulStartExecutionCommand, so the long timeout has no benefit on success. But it was super annoying on failure because every message was blocked for 15 minutes. Given that the Redrive-Lambda is manually executed, there's not much point in this.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license