Skip to content

fix: isolate pusher record-barrier transactions from shared DB workers - #24107

Merged
Git-on-my-level merged 3 commits into
mainfrom
lane/barrierexec-sealpusher
Oct 30, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
lane/barrierexec-sealpusher

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

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_barrier executor: 16 workers, 64 queued calls, asynchronous capacity waits. Existing pusher call sites inherit the isolation without editing routers/pusher.py or #24101's seal behavior. Shared DB capacity becomes 32 via PUSHER_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 through PUSHER_RECORD_BARRIER_EXECUTOR_WORKERS.

Adds omi_executor_max_workers so 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 importing utils.executors; no extra threads start until work is submitted.

Validation:

  • Targeted backend/test.sh via BACKEND_UNIT_TEST_FILE_LIST, 4 workers, under omi-heavy and nice -n 19: executor, strict Firestore seal, pusher timeline, transcript dispatch, and monitoring contracts.
  • New behavioral test forbids shared DB submission during all four barrier operations and records the actual worker thread.
  • New real pusher session test drains transcript and audio webhook queues through DB-backed fake integrations while a fake barrier executor holds a transaction pending.
  • Based on fix(pusher): preserve record seals through graceful drain #24101 merge 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 9320e0eae81eb924f92ab5bb9d0890d8e3d86fb5 was SHIP, no findings (execution exec-deputy-theme-bottom-donkey-butter-section). Delta round 2 at reviewed implementation head 569982c171eb6d693e819c0771a0ccb8a3d72076 was also SHIP, no findings (execution exec-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 8e35ec63a5146a153dac65cbcef7acefa286dabe retains both paragraphs; the reviewed executor, seal and alert files are byte-identical to 569982c171eb (which completed all 64 CI checks green). Lead ruling 5f2fd4 explicitly 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.

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T11:13:48.208353Z 8e35ec6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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
Git-on-my-level merged commit ec56c28 into main Oct 30, 2026
60 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/barrierexec-sealpusher branch October 30, 2026 11:24
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.
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