Repository navigation
fix(sync): stop routing all offline recordings through the bounded backfill lane - #10400
Merged
Merged
Conversation
An offline recording can never carry server capture proof, because the server was not in the loop when it was captured. Every offline upload therefore classifies as backfill, which routed the entire offline workload to a lane provisioned for occasional historical recovery: a worker admitting four jobs at once behind a queue offering four at a time. Cloud Run rejected the surplus with no available instance, and Cloud Tasks retried each rejection with exponential backoff up to an hour, so a recording could sit scheduled almost a day out while the workers were idle. Recordings uploaded fine and then never became conversations. The lane label stays on the payload for metering and reporting; it no longer selects the queue.
Dispatch concurrency now matches the worker's instance ceiling, a warm instance keeps a scale-from-zero poke from being rejected outright, and retry backoff is bounded so one transient rejection cannot strand a recording for hours.
kodjima33
added a commit
that referenced
this pull request
Jul 23, 2026
## What changed and why Parakeet could keep a replica Ready after a fatal CUDA stream-capture error, so one poisoned process served only HTTP 500s indefinitely. This disables CUDA graph decoding when batch and streaming inference share the GPU, makes fatal accelerator errors poison the authoritative GPU worker state, and lets health probes recycle the replica. It also adds per-pod black-hole and fatal-CUDA alerts and fixes the dashboard to use Parakeet's `success`/`error` status labels. ## Product invariants affected none ## How it was verified - Recycled the original poisoned production pod and observed its replacement become Ready and serve successful transcriptions with no CUDA/HTTP 500 errors. - The live Prometheus form of the new black-hole query then detected the same failure recurring on that replacement. Production logs confirmed the exact `cudaErrorStreamCaptureUnsupported` failure. - Completed a rolling Parakeet-only configuration change to `PARAKEET_CUDA_GRAPHS=false` while the healthy sibling continued serving. Both replacement replicas became Ready with healthy `/health` responses and served 211 real transcriptions immediately after rollout (209 + 2), with zero HTTP 500s and zero fatal-CUDA signatures. - `backend/.venv/bin/python -m pytest -q backend/tests/unit/test_parakeet_gpu_worker.py backend/tests/unit/test_parakeet_endpoints.py backend/tests/unit/test_parakeet_stream_session.py backend/tests/unit/test_parakeet_helm_contract.py backend/tests/unit/test_monitoring_alert_rule_contract.py` — 149 passed. - `make runtime-image-source-closure` — all 10 registered runtime-image contracts passed. - `PYTHON=.venv/bin/python bash test-preflight.sh` — 18 checks passed, 0 failed. - `OMI_PR_BODY_FILE=/tmp/parakeet-pr-body.md make preflight` — all 20 diff-scoped checks passed; the bounded pre-push typecheck, unit-test, OpenAPI, and formatting gate also passed. - The repository-wide `PYTHON=.venv/bin/python bash test.sh` run reached and passed every Parakeet test, but was not green due unrelated current-tree failures in desktop release contracts and fast-unit timing guards; one unrelated memory-adapter process was interrupted after remaining idle on a live Google connection for more than eight minutes. - GitHub's backend unit, image-smoke, source-closure, API-contract, sync-gauntlet, and listen-gauntlet checks passed. The broad hermetic E2E job twice reproduced the current unrelated `TestSurfaceDefaultAccessMatrix...[agent_tools]` failure (113 passed, 3 skipped); the identical failure is present on PR #10400, whose diff only touches sync cloud-task files. The real CUDA concurrency trigger was not reproduced on a development GPU. Its production recurrence and removal by the live configuration rollout provide the runtime evidence. ## Tests - `test_exact_incident_error_transitions_real_worker_health_to_unhealthy` covers the incident error flowing through the real worker state into HTTP 503 health. - `TestGPUWorkerFatalCUDA` covers fatal classification, fail-closed admission, callback idempotency, thread shutdown, ordinary error recovery, and OOM separation. - RNNT tests cover fatal startup/decode propagation and the nonfatal fallback path. - Helm tests require CUDA graphs off plus HTTP readiness/liveness probes. - Monitoring contract tests require both per-pod alerts and application status labels. ## Failure class (fixes) Failure-Class: new ## Failure-class transition narrative (only when needed) This adds `FC-poisoned-accelerator-readiness`. Violated contract: a serving GPU process whose CUDA context is unsafe must not remain Ready or accept more inference. The canonical guard is the GPU worker's fatal state, surfaced through `/health` to Kubernetes readiness/liveness, with CUDA graphs prohibited when batch and streaming inference share a process. Evidence is the 2026-07-23 production incident, its recurrence on replacement pod `prod-omi-parakeet-6cf8b5ccbf-d5786`, and the enabling configuration from PR #7938. ## New guards (only when adding a check or ratchet) The Helm and monitoring contract checks would have caught the 2026-07-23 Parakeet incident configuration and observability gaps. This is not a shared primitive because CUDA-context validity and Parakeet's mixed batch/streaming decoder configuration are specific to this GPU service. ## Scoped cleanups (optional) The Parakeet dashboard's HTTP-style `status=~"[45].."` filters were changed to the application's actual `status="error"` label.
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
## What changed and why Parakeet could keep a replica Ready after a fatal CUDA stream-capture error, so one poisoned process served only HTTP 500s indefinitely. This disables CUDA graph decoding when batch and streaming inference share the GPU, makes fatal accelerator errors poison the authoritative GPU worker state, and lets health probes recycle the replica. It also adds per-pod black-hole and fatal-CUDA alerts and fixes the dashboard to use Parakeet's `success`/`error` status labels. ## Product invariants affected none ## How it was verified - Recycled the original poisoned production pod and observed its replacement become Ready and serve successful transcriptions with no CUDA/HTTP 500 errors. - The live Prometheus form of the new black-hole query then detected the same failure recurring on that replacement. Production logs confirmed the exact `cudaErrorStreamCaptureUnsupported` failure. - Completed a rolling Parakeet-only configuration change to `PARAKEET_CUDA_GRAPHS=false` while the healthy sibling continued serving. Both replacement replicas became Ready with healthy `/health` responses and served 211 real transcriptions immediately after rollout (209 + 2), with zero HTTP 500s and zero fatal-CUDA signatures. - `backend/.venv/bin/python -m pytest -q backend/tests/unit/test_parakeet_gpu_worker.py backend/tests/unit/test_parakeet_endpoints.py backend/tests/unit/test_parakeet_stream_session.py backend/tests/unit/test_parakeet_helm_contract.py backend/tests/unit/test_monitoring_alert_rule_contract.py` — 149 passed. - `make runtime-image-source-closure` — all 10 registered runtime-image contracts passed. - `PYTHON=.venv/bin/python bash test-preflight.sh` — 18 checks passed, 0 failed. - `OMI_PR_BODY_FILE=/tmp/parakeet-pr-body.md make preflight` — all 20 diff-scoped checks passed; the bounded pre-push typecheck, unit-test, OpenAPI, and formatting gate also passed. - The repository-wide `PYTHON=.venv/bin/python bash test.sh` run reached and passed every Parakeet test, but was not green due unrelated current-tree failures in desktop release contracts and fast-unit timing guards; one unrelated memory-adapter process was interrupted after remaining idle on a live Google connection for more than eight minutes. - GitHub's backend unit, image-smoke, source-closure, API-contract, sync-gauntlet, and listen-gauntlet checks passed. The broad hermetic E2E job twice reproduced the current unrelated `TestSurfaceDefaultAccessMatrix...[agent_tools]` failure (113 passed, 3 skipped); the identical failure is present on PR BasedHardware#10400, whose diff only touches sync cloud-task files. The real CUDA concurrency trigger was not reproduced on a development GPU. Its production recurrence and removal by the live configuration rollout provide the runtime evidence. ## Tests - `test_exact_incident_error_transitions_real_worker_health_to_unhealthy` covers the incident error flowing through the real worker state into HTTP 503 health. - `TestGPUWorkerFatalCUDA` covers fatal classification, fail-closed admission, callback idempotency, thread shutdown, ordinary error recovery, and OOM separation. - RNNT tests cover fatal startup/decode propagation and the nonfatal fallback path. - Helm tests require CUDA graphs off plus HTTP readiness/liveness probes. - Monitoring contract tests require both per-pod alerts and application status labels. ## Failure class (fixes) Failure-Class: new ## Failure-class transition narrative (only when needed) This adds `FC-poisoned-accelerator-readiness`. Violated contract: a serving GPU process whose CUDA context is unsafe must not remain Ready or accept more inference. The canonical guard is the GPU worker's fatal state, surfaced through `/health` to Kubernetes readiness/liveness, with CUDA graphs prohibited when batch and streaming inference share a process. Evidence is the 2026-07-23 production incident, its recurrence on replacement pod `prod-omi-parakeet-6cf8b5ccbf-d5786`, and the enabling configuration from PR BasedHardware#7938. ## New guards (only when adding a check or ratchet) The Helm and monitoring contract checks would have caught the 2026-07-23 Parakeet incident configuration and observability gaps. This is not a shared primitive because CUDA-context validity and Parakeet's mixed batch/streaming decoder configuration are specific to this GPU service. ## Scoped cleanups (optional) The Parakeet dashboard's HTTP-style `status=~"[45].."` filters were changed to the application's actual `status="error"` label.
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.
Offline recordings uploaded successfully and then sat unprocessed for many
hours. The queue backing the historical-recovery lane had built up ~14.7k
tasks, some scheduled almost a day after they were created, while the workers
behind it were idle.
What was happening
classify_sync_lanemarks an uploadfreshonly when the server cancorroborate its capture time against a conversation it already knows about. An
offline recording has no such conversation — the server was not in the loop
when it was captured — so every offline upload classifies as
backfill,regardless of age. Production shows recordings thirty seconds old admitted as
lane=backfill trust=legacy reason=unbound_capture_time.That sent the entire offline workload to a lane provisioned for occasional
historical recovery: a worker capped at four instances at one request each,
behind a queue offering four dispatches at a time.
The failure was not throughput, it was compounding retry delay:
Raising the worker to thirty barely moved throughput, because the backlog was
waiting on backoff rather than capacity. Bounding the backoff took completions
from roughly eight per minute to fifty, with rejections falling to zero.
Changes
Route every sync job to the main queue. The main queue has no dispatch cap,
which is what offline sync ran on before the lane split. The lane label stays on
the payload for metering and reporting; it no longer selects the queue.
Size the lane so dispatch cannot outrun the worker. Dispatch concurrency now
equals the worker's instance ceiling — offering more than the worker admits is
what produced the rejections. A warm instance keeps a scale-from-zero poke from
being rejected outright, and retry backoff is bounded so one transient rejection
cannot strand a recording for hours.
The deploy action previously hardcoded the old four-and-four sizing on every
run, so any manual tuning was silently reverted by the next deploy.
Tests
test_backfill_lane_still_uses_the_main_queueasserts a payload carrying thebackfill lane enqueues to the main queue and handler, with the label preserved.
The lifecycle contract test asserts the matched sizing and the bounded backoff.
tests/unit/test_sync_two_lane.pyandtests/unit/test_sync_v2.py— 199 passed.Nine failures in
test_sync_cloud_tasks.pyreproduce identically on anunmodified checkout; they are a
fakeredisartifact in this environment and areunrelated to this change.
Failure-Class: none