Repository navigation
fix: isolate pusher record-barrier transactions from shared DB workers - #24107
Merged
Merged
Conversation
Route custody transactions through a bounded monitored pool; preserve seal ordering while keeping integration consumers off its retry backlog. Add DB headroom and a capacity-aware 10-minute saturation alert. Failure-Class: none
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The notification contract requires a committed dashboard link for every alert. Add the Pusher dashboard URL in both alert exports and regenerate the source-only GMP query consumer inventory for the new alert expression. Failure-Class: none
Retain both the executor isolation paragraph and the new sweeper paragraph at their shared insertion point. The conflict resolution changes docs only; the reviewed executor, seal and alert implementation is unchanged.
Git-on-my-level
added a commit
that referenced
this pull request
Oct 30, 2026
#24104) ## Summary Completed batch-live captures without a deterministic job can remain unsealed and never reach transcription. Add a one-time operator tool that scans at most 128 conversation references per resumable page, proves retained tails and dead producers, and atomically seals each eligible row with canonical `record_pending` registration. Dry-run accepts `ro-prod` or `prod-operator`; apply requires `prod-operator` and a fresh `--approve-plan-sha256`. Output contains aggregate counts, closed dispositions and the plan digest. Private cursor files stay in 0700 Ephemeral scratch directories and are written as 0600. Explicit serving-role admission flags prevent operator environment settings becoming a stored job policy. Failed uploads and privacy-excluded rows stay untouched. The flags file must provide both current batch and retirement ramps; incomplete, nonfinite or non-nested values are refused before planning. An empty discovery page resets the private output cursor for another bounded pass. Repeat passes and reconcile aggregate no-job counts before declaring settlement; an empty page alone is not a completion proof. The finalizer now fails retryably on registration refusal for audio obligations. Proven closed, never-received server captures retain ordinary photo finalization without an audio job; upload failures, pending producers and unknown/unclosed archives retain the strict gate. Silent backfill registers an existing audio obligation before returning its existing processing fence. Intentional-discard retry churn and a restore-aware correction are tracked in #24110 under lead ruling f498ab; the model-only discard prototype was reverted because a concurrent restore could lose the audio obligation. ## Validation - Targeted integrated `backend/test.sh` shards: 387 passed, 2 emulator-only tests skipped, including executor/barrier compatibility; through `omi-heavy`, `nice -n 19` and `BACKEND_UNIT_TEST_FILE_LIST`. Final tree is byte-identical to validated 04e0c76; the discarded prototype's 390-test result is not final-tree evidence. - Focused isolated Firestore emulator: 2 passed (real paging and transaction rollback). - Hermetic listen/pusher stack and 13 concurrency tests passed at d7a4fbe; exact-head CI passed all runtime gauntlets at bc84bcb. After the documentation-only #24107 integration, two local reruns hit the canonical 20-second service-readiness deadline. Lead 6b0c0d authorizes relying on final exact-head backend CI after that repeated startup timeout; no harness timeout or code changed. - Repository preflight and exact-head GitHub checks: results recorded before merge readiness. - No production access or data mutation. The rollout lead owns dry-run/apply. Backend deployment is needed for the finalizer fix; the operator tool runs from this reviewed commit. Failure-Class: FC-split-mutation-authority Line-Count-Exception: backend/utils/conversations/finalizer.py | 792 -> 812 | Retain audio obligations before terminal fanout and preserve main refusal telemetry, ordinary photo finalization for proven-empty archives, and the silent-backfill processing fence. The backfill uses canonical registration in the seal transaction and shares the retained-tail proof with the existing repair tool. Regression tests enforce privacy/read-before-write fences and refusal before finalizer terminal fanout.
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.
Record-barrier Firestore retries currently occupy the shared DB pool used by transcript and audio webhook consumers. The 2026-10-30 custody verdict measured DB saturation at 24/24 after #24084, 121-163 session closures/hour, and roughly 10k transcript queue drops/hour.
This isolates all four barrier dispatches (begin, clear, seal, failure marker) on a monitored
record_barrierexecutor: 16 workers, 64 queued calls, asynchronous capacity waits. Existing pusher call sites inherit the isolation without editingrouters/pusher.pyor #24101's seal behavior. Shared DB capacity becomes 32 viaPUSHER_DB_EXECUTOR_WORKERS; 32 supplies 12 workers of headroom above the verdict's pre-regression peak of 20, while isolation removes the new workload. The barrier worker count is tunable throughPUSHER_RECORD_BARRIER_EXECUTOR_WORKERS.Adds
omi_executor_max_workersso the Prometheus-backed Grafana pusher alert fires per scrape target at configured DB capacity for 10 minutes, summing all task labels. Both maintained and combined alert exports are updated. No production state has been accessed or changed; the lead must provision the alert and roll pusher in the same train as #24101. Shared executor defaults also apply to other processes importingutils.executors; no extra threads start until work is submitted.Validation:
backend/test.shviaBACKEND_UNIT_TEST_FILE_LIST, 4 workers, underomi-heavyandnice -n 19: executor, strict Firestore seal, pusher timeline, transcript dispatch, and monitoring contracts.f436f8821b58, preserving its returned seal-refusal handling and shutdown/ACK logic. After syncing fix: reconcile abandoned recording producer seals in cluster #24105/main, targeted 15-file unit shard: 362 passed, including the strict custody and seal/ACK cases. The full 24-file monitoring selector passed 558 tests. Hermetic E2E on the combined tree: 175 passed, 3 skipped, 2 expected failures. Repository preflight: 38 checks passed; full ordinary push hooks run on each published head.The first CI run found two alert metadata requirements outside the initial local subset: a dashboard link and a current source-only GMP query inventory. Both failures reproduced locally. The correction adds the committed Pusher dashboard URL to both exports and regenerates the query inventory offline; it changes no executor or seal logic. All 24 files from the monitoring changed-file selector pass locally (558 tests), including both formerly failing contracts; the expanded 14-file functional set also passed 327 tests.
Review: Luna full read-only round 1 at
9320e0eae81eb924f92ab5bb9d0890d8e3d86fb5was SHIP, no findings (executionexec-deputy-theme-bottom-donkey-butter-section). Delta round 2 at reviewed implementation head569982c171eb6d693e819c0771a0ccb8a3d72076was also SHIP, no findings (executionexec-endless-unfold-occur-october-leg-meadow). Reviewers did not run tests; local validation is recorded above. Each published head passed ordinary push hooks; fresh exact-head terminal CI remains required for merge. Lead owns merge and deploy. No.github/edits, data changes, or flag changes.Main sync: #24105 added the sweeper paragraph at our executor paragraph's insertion point. Merge
8e35ec63a5146a153dac65cbcef7acefa286daberetains both paragraphs; the reviewed executor, seal and alert files are byte-identical to569982c171eb(which completed all 64 CI checks green). Lead ruling5f2fd4explicitly approves this docs-only resolution and reuse of both SHIP reviews without a third round. The synced head requires its own green CI before the lead merges.Rollback: restore prior worker env values through the normal release path for tuning; code rollback requires lead review to retain #24084/#24101 custody semantics.
Failure-Class: none
Failure-Class-Reason: The registry has no matching shared Firestore worker contention class; GPU batch/live scheduling and lifecycle ownership classes describe different contracts. The new consumer-isolation behavioral test guards this mechanism without changing registry/workflows in this urgent PR.