Repository navigation
Conversation
… tick The sync-backfill-uid-sequencer scheduler sweep wraps every per-owner and per-pending-job operation in try/except, but the two bulk queries that feed those loops (due_owners, due_pending) were unguarded. A transient Firestore error from either query (ServiceUnavailable, DeadlineExceeded, etc.) propagated out of sweep() uncaught, turning one scheduler tick into an HTTP 500 at the /v2/sync-backfill-sequencer/sweep endpoint instead of degrading to a no-op tick that the next scheduled run retries. Wrap both queries the same way the rest of the function already treats per-item failures: log and continue with an empty list for this tick. fixes #21122
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.
What
uid_sequencer.sweep()already wraps every per-owner and per-pending-job operationin
try/except, logging and continuing on failure so one bad item never kills thewhole scheduler tick. The two bulk queries that feed those loops —
due_owners()and
due_pending()— were the only unguarded calls in the function. A transientFirestore error from either query (e.g.
ServiceUnavailable,DeadlineExceeded)propagated straight out of
sweep(), turning that one scheduler tick into anHTTP 500 at
/v2/sync-backfill-sequencer/sweepinstead of degrading to a no-optick that the next ~2-minute scheduled run retries.
Wraps both queries the same way the rest of the function already treats
per-item failures: log the exception type and continue with an empty list for
this tick.
Why
Fixes #21122 —
sync-backfill-uid-sequencerscheduler sweep returningintermittent HTTP 500, trending from ~0.3% of ticks on Oct 4 to ~4.6% on Oct 9
(78 failures over 7 days). The issue reporter noted sweeps self-recover on the
next successful execution and there's no user-facing impact today, but the
error-rate trend is climbing with no bound, and an uncaught exception at the
query layer is the one place in this function that didn't already follow its
own established resilience pattern.
What I tested
Ran the full existing sequencer suite plus two new regression tests
(
test_sweep_tolerates_due_owners_query_failure,test_sweep_tolerates_due_pending_query_failure) that monkeypatchdue_owners/due_pendingto raise and assertsweep()returns a degradedoutcome dict instead of raising:
Failure-Class: none
Auto-generated from issue feedback by the mini issues-improver — tested and merged.