Skip to content

fix(sync): turn off per-uid backfill in-flight limit - #19352

Merged
Git-on-my-level merged 1 commit into
mainfrom
fix/sync-backfill-inflight-off
Sep 27, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
fix/sync-backfill-inflight-off

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

Set SYNC_BACKFILL_INFLIGHT_LIMIT=false on backend-sync and backend-sync-backfill (dev and prod) to stop the per-uid backfill slot from refusing sync uploads with 429 backfill_paced.

Why

  • 9e6b55b (deployed to prod 2026-09-25 16:55Z) re-armed a one-job-per-uid backfill slot, with a 2-day TTL, that defaults on.
  • Since 17:00Z that day, POST /v2/sync-local-files has returned 429 at a steady 300–560/h. That is 9,508 of about 25,500 requests (37%) over 24 h. On 09-21 and 09-22 there were 0.
  • 94% of uploads are classified backfill / unbound_capture_time, including recordings under an hour old. Offline captures have no capture manifest, so ordinary offline recordings queue on phones. One account has 236 pending.
  • The server is not saturated: /v2/sync-jobs/run p50 is 5 s and p90 38 s, and the sync-backfill Cloud Tasks queue (30 concurrent) is nearly empty.
  • With the flag off, try_acquire_backfill_slot returns to its pre-9e6b55b behavior: always admit, 202, and Cloud Tasks paces. The dead-letter work from 9e6b55b is unchanged.

A separate review of why the slot was added, and of a long-term design (for example, per-uid serialization inside the job layer instead of refusing uploads), is in progress.

Risk / monitoring

  • Concurrent backfill jobs for one uid run again, as they did before 09-25.
  • Post-deploy, watch 429 share, sync job failures and dead letters, duplicate or fragmented sync conversations, and backend-sync errors and latency.
  • Rollback: set the value back to 'true' and redeploy, or shift Cloud Run traffic to the prior revision.

Product invariants affected

  • INV-MEM-4 (path match only: runtime_env.yaml; no memory intake or promotion behavior changes)

Failure-Class: none

🤖 Generated with Claude Code

Review in cubic

9e6b55b re-armed a one-job-per-uid backfill slot that 429s 37% of sync
uploads; Cloud Tasks queue concurrency already paces backfill work.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 89138ed into main Sep 27, 2026
66 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/sync-backfill-inflight-off branch September 27, 2026 07:11
Git-on-my-level added a commit that referenced this pull request Nov 9, 2026
…bt, ops_kill defaults on (#24954)

<!-- claude-projects-attribution: {"github_login":"Git-on-my-level"} -->
_Requested by **David**_

David approved 2026-11-08 17:09Z: enforce review_by and done_by in CI,
sweep the registry metadata, and make ops_kill mean default on. This
applies those rules and the lead's subsequent sweep rulings. The
pre-sweep registry had 82 rollout/experiment rows whose review dates
would fail the old seven-day-grace checker on 2026-11-12, turning every
PR red without a sweep (measured against the saved pre-sweep registry on
2026-11-08 19:24Z).

- Use UTC for the default check date so UTC+7 pre-push hooks agree with
CI.
- Enforce review dates and pending rollout ramp completion dates with
the same seven-day grace. A row's single extension affects both
deadlines. Decided flags still read by code must retire their code
paths.
- Validate a single self-service extension of at most 14 days, with a
meaningful reason, lane, and grant date that has already occurred.
Compare against the merge-base to refuse second extensions and later
original deadlines, for pending and already-decided rows. Existing ramp
plans cannot lose their deadline while ramp enforcement still applies.
Missing merge-base data explicitly warns and skips diff rules.
- Count only pending rollout debt without a live dated ramp toward the
owner cap of five, including all new debt added in the same PR. Reject
any account token on new rows (existing rows are grandfathered), split
shared owners on /, comma, &, +, | and whitespace-delimited "and", and
count each debt row once per distinct normalized lane token. Remove the
dazheng backlog exception.
- Reject default-off ops_kill rows except the 18 remaining migration
exceptions, which expire 2026-11-29. Retain stale-entry and expiry
enforcement. Warn about rollout rows decided keep/with_legacy.
- Emit FLAG_DUE_SOON, FLAG_OVERDUE_COUNT, FLAG_DARK_OVER_14D and the
revised FLAG_OWNER_BACKLOG counts; regenerate the registry documentation
with its existing 2026-11-05 header.

The CSV contains 307 rows: 304 active rows were applied;
SYNC_BACKFILL_INFLIGHT_LIMIT was already retired in #19352, and two
DREAM_NO_PROGRESS_STOP_MODE rows retired in #24955 were preserved when
merging current main. None was recreated. All other 286 rows still owned
by dazheng were reassigned. Owner assignments to omi-pipeline now
require an existing origin/main assignment or
PROJECTION_DRAIN_LIVE_TARGET_BACKOFF. Assignments to backlog-refactor
require an existing origin/main assignment or the accepted BATCH_/SYNC_
scope; other previously inferred assignments go to auditfix pending
retirement or an explicit owner claim. No account owner token remains in
flags, ignored entries, or retired entries (verified with the same
tokenizer used by the checker). The ignored entries
localEmbeddingsEnabled and meeting_note_screenshots_enabled also move
from dazheng to auditfix; active flag owner counts below are unchanged.
All 97 exceptions introduced by #24950 are now extended rows, permanent
lifecycles, or retired upstream; REVIEW_OVERDUE and _AD1268_SWEEP are
removed.

| CSV action | Rows | Applied treatment |
| --- | ---: | --- |
| A | 15 | Extension through Nov22; two subsequently retired in #24955 |
| B | 65 | Extension through Nov22, preserving client-surface reason |
| C | 12 | Extension through Nov22 |
| D | 88 | Extension through Nov22 |
| E | 15 | Extension through Nov22 |
| E-MISMATCH | 40 | Extension through Nov22 |
| F → config_switch | 32 | Relabel permanent opt-in controls |
| F → rollout | 17 | Relabel and add missing review_by Nov22 only |
| G → config_switch | 15 | Relabel 14 active rows; one already retired |
| G → ops_kill | 8 | Per lead ruling, use config_switch because all
eight default off |

There are 234 bounded extensions, all granted Nov8 by auditfix and
ending Nov22. One additional extension covers
AUDIO_ARCHIVE_STOP_PCM_PERCENT, outside the CSV, whose unchanged Nov14
ramp deadline would otherwise fail Nov23. Permanent G relabels drop
inapplicable review/ramp metadata and preserve the old review date in
notes. No decision, terminal, parser fail/default, runtime value, or
production value changed. Existing dates were not postponed: the only
original review/ramp metadata changes are the explicitly approved G
removals; 17 missing F review dates were added. The checker change also
aligns the policy validation script (`backend/config/policy/guard.py`):
default-on live controls must remain ops_kill; opt-in live controls may
be config_switch or rollout. Hermetic fixtures cover both accepted and
rejected lifecycles. The backend flag-budget fixture also follows the
approved rollout labels and lane ownership, rather than freezing the
former account owner. No workflow or runtime application code changed.
No production access was used.

CSV proposed-owner counts (unowned mapped to auditfix): omi-pipeline
122; auditfix 82; backlog-refactor 78; uicleanup 19; firestore-lead 2;
cl2-coordkit 2; pgfoundation 1; cl2-deploy 1. The already-retired limit
row is included in the backlog-refactor source count; the two
subsequently retired Dream rows are included in the auditfix source
count.

Registry-wide owner counts after reassignment (712 rows). The ownership
correction moves 179 rows from omi-pipeline and 62 from backlog-refactor
to auditfix. The ownership correction changes no decision, deadline,
lifecycle, extension, fail/default, or runtime value. Shared-owner
validation now refuses account tokens on added rows and applies the cap
separately to each named lane, with duplicate lane tokens counted once;
existing rows remain exempt from the new-row account rule. Regression
fixtures cover every separator, lane-only acceptance, legacy rows,
shared existing debt and batched additions.

| Owner | Before correction | After correction |
| --- | ---: | ---: |
| auditfix | 190 | 431 |
| backlog-refactor | 181 | 119 |
| unowned | 40 | 40 |
| two-lane lead | 27 | 27 |
| uicleanup | 23 | 23 |
| backend | 14 | 14 |
| planscost | 8 | 8 |
| merge-desk | 6 | 6 |
| omi-pipeline | 184 | 5 |
| firestore-lead | 4 | 4 |
| home-overlap | 4 | 4 |
| review-desk | 4 | 4 |
| lead2 | 3 | 3 |
| two-lane rollout lead | 3 | 3 |
| cl2-coordkit | 2 | 2 |
| cl2-deploy | 2 | 2 |
| pgfoundation | 2 | 2 |
| speaker rollout lead | 2 | 2 |
| vroute-c / batch rollout lead | 2 | 2 |
| backend listen | 1 | 1 |
| backend runtime_env (PR #18855) | 1 | 1 |
| cl2-cost / lead2 | 1 | 1 |
| flightcut / batch rollout lead | 1 | 1 |
| fswrites | 1 | 1 |
| nik | 1 | 1 |
| omi-lifecycle | 1 | 1 |
| rollout-meetings | 1 | 1 |
| speakerrename | 1 | 1 |
| uicleanup (omi-lifecycle) | 1 | 1 |
| uicleanup / omi-lifecycle | 1 | 1 |

Validation (measured locally; CI is separate). The owner correction
reruns the fixtures, six as-of CLI checks, and unchanged normal push
hooks; historical broader audit results below are identified by scope.
No owner backlog exception has been added.


- `nice -n 15 timeout 1500 backend/.venv/bin/python -m unittest discover
-s scripts -p 'test_*flag*.py'`: **102 passed**, 146.373 seconds (91
checker fixtures and 11 PostHog fixtures). The focused owner subset
passed **14 tests**, including all requested spellings and shared-lane
cap cases.

- `nice -n 15 timeout 1500 backend/.venv/bin/python -m pytest -q
backend/tests/unit/test_flag_budget.py`: **24 passed** in the normal
push hook.
- Earlier registry-coupled backend audit using canonical
`backend/test.sh`, an explicit nine-file list and two isolated workers:
**430 tests passed across all 9 files** (includes the 24 budget tests
above). Default/off runtime assertions remain intact.
- Full local manifest preflight and supplied PR-body validation, through
the unchanged normal pre-push hook (same manifest as `make preflight`):
**40 checks passed**, 285 seconds. No skip flags. The remaining normal
pre-push gates also passed, and the branch was pushed successfully.
- Full checker CLI `scripts/check_feature_flag_registry.py --as-of DATE`
on head `99c25a16e58695b1e49729ea88070cb882e32c12`:

| As of | Errors | Result |
| --- | ---: | --- |
| 2026-11-08 | 0 | Pass |
| 2026-11-12 | 0 | Pass |
| 2026-11-16 | 0 | Pass |
| 2026-11-19 | 0 | Pass |
| 2026-11-23 | 28 | Only pre-existing duplicate-declaration exceptions
expired Nov20 (workstream B) |
| 2026-11-30 | 18 | Expected default-off ops_kill migration exceptions
expired Nov29 |

All twelve daily schema/deadline boundary checks for Nov8 through Nov19
also pass. Nov30 returns at schema validation on the 18 migration
expiries, so that output does not enumerate the subsequent row-deadline
failures. Raw outputs and UTC measurement receipts are saved in the
owning run directory as `out-checker-asof-<date>.txt` and
`checker-asof-receipt.json`.


Product invariants affected: none (`scripts/pr-preflight --suggest`).

Failure-Class: none

This hardens repository registry governance; no existing semantic
runtime failure class matches these validation bypasses. Reusable guards
and regression fixtures live in
`scripts/check_feature_flag_registry.py`,
`scripts/feature_flag_registry.py` and
`scripts/test_check_feature_flag_registry.py`.




<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24954?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/24954?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24954&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->

🤖 Generated with [Claude Code](https://claude.com/claude-code).
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