Repository navigation
Fix task identifier cache recovery after database errors - #637
Open
hemesh-demi wants to merge 1 commit into
Open
hemesh-demi wants to merge 1 commit into
hemesh-demi wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
If a task identifier lookup rejects after
withRetriesgives up,getTaskDetailscaches the rejected promise. Subsequent polls with the same task list reuse that rejection, so workers can stop claiming jobs even after the database recovers.Clear the failed cache entry so the next poll can retry. Guard both completion paths by promise identity, so an older lookup cannot clear or overwrite a newer task list's cache. Successful lookups remain cached and concurrent callers still share one pending lookup.
Adds a patch changeset and five focused tests covering
53300/ECONNRESETrecovery, concurrent callers, and stale success/failure. Four fail on current main; all five pass with this change. Tests control the database boundary after connection retries; no live database is required.Validation: focused Jest suite, source and test TypeScript checks, scoped ESLint and Prettier checks. Full database integration suite not run.