fix(core): gracefully discard queue messages when process not found#584
Draft
d-klotz wants to merge 1 commit into
Draft
fix(core): gracefully discard queue messages when process not found#584d-klotz wants to merge 1 commit into
d-klotz wants to merge 1 commit into
Conversation
When a sync process is deleted mid-flight (e.g., completed or cancelled while pagination messages are still in the queue), loadIntegrationForProcess threw an unclassified error. Since the error has no statusCode, the queue worker retried it 4 times before sending it to DLQ — wasting Lambda invocations on a permanently unrecoverable condition. Now loadIntegrationForProcess returns null (matching loadIntegrationForWebhook pattern), and the QueueWorker discards the message with a warn log. Production evidence: 7 DLQ events/day for FETCH_PERSON_PAGE with integrationId: null, all processIds belonging to already-completed syncs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
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.


Summary
Root Cause
When a sync process completes while FETCH_PERSON_PAGE messages are still in the SQS queue, loadIntegrationForProcess throws Error(Process not found). This error has no statusCode, so it gets retried 4 times then DLQed.
Production Evidence (Quo, 2026-05-11)
Test plan