You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sync-backfill-uid-sequencer Cloud Scheduler job (us-central1, project based-hardware) is intermittently failing with HTTP 500 from the sweep endpoint. The failure rate is escalating.
This is unrelated to #19504 (dispatch 429 aborts, which are fixed). This is the scheduled sweep itself returning 500s.
Observed behavior
Target:/v2/sync-backfill-sequencer/sweep on backend-sync Cloud Run service
Error:URL_UNREACHABLE-UNREACHABLE_5xx — HTTP 500
Response latency: 20–28s on failures (same range as successful runs at 19–46s)
Update: Oct 14-15 — failure rate escalating, queue congested
Failure trend (continued from Oct 10)
Date
Failure rate
Oct 4-6
~0.3%
Oct 7
~0.7%
Oct 8
~1.9%
Oct 9
~4.6%
Oct 10
~4.1%
Oct 14
31.8%
Oct 15 (partial)
52.9%
Error pattern changed
Oct 4-10: HTTP 500 (URL_UNREACHABLE-UNREACHABLE_5xx)
Oct 14-15: 100% NotFound exceptions — Firestore documents missing during reconcile_uid calls
Queue status
Dispatched jobs: 0 — zero jobs dispatching across all sweeps
Active leases at sweep scan cap (100), queued depth at cap (100)
Queue is fully congested — no new backfill work is being processed
User impact
Users with pending backfills older than 12 hours: 50+
Oldest pending backfill: ~54.5 hours (~2.3 days)
Median pending age: ~43.9 hours
Severity reassessment
Original filing (Oct 10) assessed impact as Low with self-recovery. With zero dispatches and queue congestion, this is no longer self-recovering. Backfill processing is effectively stopped.
Head-of-Line Blocking in sweep(): In �ackend/utils/sync/uid_sequencer.py (sweep()), when
econcile_uid(owner['uid'], owner, ...) encountered an exception, it recorded outcome = 'error' and logged, but never called
egistry.defer_owner(owner['uid'], ...). Consequently, failing owners remained with
econcile_at <= now and were re-queried on every single scheduler tick. When multiple owners failed, they filled all 100 slots in due_owners(limit=100), starving healthy accounts and completely halting backfill dispatching across all sweeps.
Missing Document NotFound Handling: Transactional updates in defer_owner,
edrive_job, �egin_job, and
enew_job did not catch google.api_core.exceptions.NotFound (unlike defer_pending). When a document was concurrently deleted or missing, the update threw an unhandled 404/NotFound exception.
Query Resilience: Transient timeouts during due_owners or due_pending query streams were unhandled at the outer tick boundary.
Owner Deferral on Reconcile Error: In uid_sequencer.sweep(), when
econcile_uid catches an exception, it now defers the owner by HEARTBEAT_SECONDS (
egistry.defer_owner(owner['uid'], registry.HEARTBEAT_SECONDS, now=now)), immediately rotating the bounded page and unblocking the rest of the queue.
Firestore NotFound Resilience: Wrapped transactional commits in defer_owner,
edrive_job, �egin_job, and
enew_job with except NotFound: handlers to safely treat missing documents as non-fatal.
Query Stream Guarding: Wrapped due_owners() and due_pending() in sweep() to gracefully log due_owners_error / due_pending_error and continue remaining work without crashing.
Hermetic Unit Test Suite: Added 5 new unit tests in �ackend/tests/unit/test_sync_backfill_uid_sequencer.py verifying that failing owners are deferred and unblock subsequent owners, and that NotFound / query exceptions are handled cleanly. All 81 tests pass.
This critical P1 sync outage is now resolved in PR #21811 (merged by @kodjima33 into main):
Queue Head-of-Line Starvation Resolved: Unhealthy/failing owners are now deferred by HEARTBEAT_SECONDS, rotating the bounded due page and restoring dispatching for all healthy backfill jobs.
NotFound & Query Resilience: Missing documents during job renewal, deferral, and redrive are safely absorbed without aborting sweeps, and outer query failures no longer crash the scheduler loop.
Unit Tested: Full test suite added in backend/tests/unit/test_sync_backfill_uid_sequencer.py verifying multi-tick rotation and error tolerance.
Activity
beastoin commentedon Oct 15, 2026
Update: Oct 14-15 — failure rate escalating, queue congested
Failure trend (continued from Oct 10)
Error pattern changed
URL_UNREACHABLE-UNREACHABLE_5xx)NotFoundexceptions — Firestore documents missing duringreconcile_uidcallsQueue status
User impact
Severity reassessment
Original filing (Oct 10) assessed impact as Low with self-recovery. With zero dispatches and queue congestion, this is no longer self-recovering. Backfill processing is effectively stopped.
cc @Git-on-my-level
by AI(chen) for @beastoin
hardik4love-lang commentedon Oct 16, 2026
Submitted fix in PR #21811: #21811
Root Cause Analysis
econcile_uid(owner['uid'], owner, ...) encountered an exception, it recorded outcome = 'error' and logged, but never called
egistry.defer_owner(owner['uid'], ...). Consequently, failing owners remained with
econcile_at <= now and were re-queried on every single scheduler tick. When multiple owners failed, they filled all 100 slots in due_owners(limit=100), starving healthy accounts and completely halting backfill dispatching across all sweeps.
edrive_job, �egin_job, and
enew_job did not catch google.api_core.exceptions.NotFound (unlike defer_pending). When a document was concurrently deleted or missing, the update threw an unhandled 404/NotFound exception.
Summary of Changes in PR #21811
econcile_uid catches an exception, it now defers the owner by HEARTBEAT_SECONDS (
egistry.defer_owner(owner['uid'], registry.HEARTBEAT_SECONDS, now=now)), immediately rotating the bounded page and unblocking the rest of the queue.
edrive_job, �egin_job, and
enew_job with except NotFound: handlers to safely treat missing documents as non-fatal.
fix(sync): unblock backfill queue with owner deferral and NotFound re…
hardik4love-lang commentedon Oct 16, 2026
This critical P1 sync outage is now resolved in PR #21811 (merged by @kodjima33 into main):
HEARTBEAT_SECONDS, rotating the bounded due page and restoring dispatching for all healthy backfill jobs.backend/tests/unit/test_sync_backfill_uid_sequencer.pyverifying multi-tick rotation and error tolerance.Bounty Claim Details
@kodjima33 @josancamon19 @beastoin