Skip to content

fix(sync): cap deterministic repeat failures and fix persistence loop - #19421

Merged
Git-on-my-level merged 4 commits into
mainfrom
fix/sync-repeat-failure-cap
Sep 27, 2026
Merged

Git-on-my-level merged 4 commits into
mainfrom
fix/sync-repeat-failure-cap

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Keep an owner-fenced, content-keyed strike count in the existing 45-day sync ledger. Three identical whole-job failure fingerprints within 24 hours pause that exact content for 24 hours before dispatch or paid STT.
  • Count only undecodable audio (sync_invalid_audio) and persistence data-shape failures with the same bounded persistence:<exception subtype> fingerprint. Unknown errors, assignment conflicts, contention, provider errors, mixed segment failures, and transient network failures cannot strike; an intervening unclassified failure resets the streak.
  • Return the existing HTTP 202 job contract for capped content, with a failed job carrying reason_code=sync_repeat_failure_paused. Shipped mobile treats this as a per-WAL retryable failure and retains the file without starting an account-wide cooldown. No new job status is introduced.

Incident evidence and limits

  • The 2026-09-27 monitor shows one device repeatedly submitting six files and consuming STT before every phase=persistence failure_class=OtherException failure. The current worker catches the exception and emits only the bounded class, with no traceback in Cloud Run logs, so the underlying subtype cannot be confirmed retrospectively. The cap will apply only if a future attempt supplies an approved identical subtype; bounded subtype logging now makes that distinction observable. Assignment conflicts and contention cannot strike.
  • A separate device repeatedly submits undecodable Opus frames. Cloud Run logs show OpusError, then a whole-job failed with reason_code=sync_invalid_audio. The current app retains these bytes and marks an upload-level 400 uploadRejected, showing Delete rather than a retry action. A capped attempt therefore returns a failed 202 job; its generic reason keeps the WAL on the per-file retry path. First decode attempts retain their original terminal semantics.
  • PR feat(sync): per-UID backfill sequencer with 202 admission #19362 merged while this review was in progress. This branch merged current origin/main; the cap remains before sequencer registration and dispatch.
  • No production account documents or audio were read.

Verification

  • BACKEND_UNIT_TEST_FILE_LIST=$PWD/.local/repeat-tests-list backend/test.sh
  • flutter test test/unit/sync_job_terminal_policy_test.dart
  • backend/scripts/typecheck.sh
  • OMI_PR_BODY_FILE=.local/pr-body-repeat-failure.md make preflight

Failure-Class: new

Line-Count-Exception: backend/routers/sync.py | 2397 -> 2449 | The admission response and terminal cleanup preserve the route and fence boundaries after PR #19362 added the sequencer.
Line-Count-Exception: backend/utils/sync/pipeline.py | 2571 -> 2678 | Segment fingerprinting and terminal result propagation stay in the pipeline coordinator that owns STT and job finalization.

@Git-on-my-level
Git-on-my-level merged commit 227411f into main Sep 27, 2026
63 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/sync-repeat-failure-cap branch September 27, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant