Repository navigation
fix(deploy): model Pusher surge capacity the way the scheduler and autoscaler do - #12429
Merged
Merged
Conversation
…toscaler do The gate demanded that every surge pod fit on one already-Ready node. Two things are wrong with that. Kubernetes never makes a rollout's surge pods share a node, and a node pool below its autoscaler maximum can still supply the room - but the gate fails before Helm creates the Pending pod the autoscaler reacts to, so the pool is never asked. Prod pusher-pool-v3 sits at 6 of a maximum 50 with ~150m CPU free per node, and maxSurge 2 at 700m/4.5Gi can never fit on one n4-highmem-2: the lane was permanently red. Surge pods are now placed one at a time across matching nodes, and remaining pool growth counts as capacity when one fresh node of that pool - allocatable minus the DaemonSets it will inherit - would fit a pod. Growth comes from the cluster-autoscaler status ConfigMap, so no new credential or CLI is involved. The gate stays closed on what it was written to catch: nothing placeable, a pool at its maximum, a pool whose empty nodes are too small, and a cluster that publishes no autoscaler status.
Six new cases: surge spread across two nodes, full nodes passing on growth, and fail-closed for a pool at max, a fresh node too small for the request, an absent autoscaler status, and an unparseable one.
Git-on-my-level
added a commit
that referenced
this pull request
Aug 30, 2026
…equires (#12443) ## What broke Live-captured conversations stopped finalizing in production at **2026-08-30T15:21:42Z** and are still failing. The pusher had not deployed since **2026-07-01** (`2ae7f78841`). #12429 fixed the pre-Helm capacity gate that was failing the lane, and the rollout that followed (Helm applied 15:16:28Z, complete 15:28:51Z) carried two months of change onto a Deployment whose environment was never extended to match. The old pusher never ran this code. Its opcode-104 handler called `process_conversation` directly and never touched the durable-job architecture. Today is the **first time the pusher has ever executed `finalize_persisted_conversation`** — cold activation of a dormant subsystem, not a contract drift. Verified: `backend/routers/pusher.py`, `backend/utils/listen_pusher_session.py` and `_claim_finalization_job_txn` are byte-identical across `6f7c57ac15..6134ebd`. ## Root cause The pusher chart ships **68 env vars where backend-listen ships 115**, and `MEMORY_ENABLED` is among the 50 it lacks. Confirmed against the live cluster: ``` prod-omi-pusher 68 env vars, zero MEMORY_* vars prod-omi-backend-listen 115 env vars, MEMORY_ENABLED=on ``` `rollout_mode_env_value()` fail-closes to `off` when the flag is unset (`backend/config/memory_rollout.py`). `MemoryService.ensure_canonical_mutation_ready()` — called **unconditionally and unwrapped** by `_extract_memories_inner` for every non-discarded conversation — then raises `HTTPException(503, "Memory writes are globally paused")`. `finalizer.py` converts that to `ConversationFinalizationError('processing_failed')`, and the listen session retries roughly 4x per conversation. Measured distribution in a clean window (23:00–23:10Z, all entries): | Exception | Count | Share | | --- | --- | --- | | `HTTPException` (this bug) | 366 | 89.5% | | `LegalHoldAuthorityUnavailable` | 43 | 10.5% | This PR fixes the 89.5%. The remainder is a separate, older regression — see below. ## Why nothing paged `finalizer.py` logs only `type(error).__name__`. Production emitted ~16k/hour of bare `error=HTTPException` carrying no status code, no detail and no traceback, so the signature read as already-known. The listener itself stayed healthy throughout — WS connections in band, 5/5 ready pods, listen-LB 5xx at zero, every `Backend-listen` critical rule inactive, and no client-side Sentry spike. Audio was captured and transcribed; it simply never became a conversation. ## The fix Set `MEMORY_ENABLED=on` for dev and prod pusher, matching backend-listen. It is a plain literal, so it requires no key from the pusher's ExternalSecret — deliberately avoiding the failure class from #12298, where a chart consumed a secret key the ExternalSecret did not enumerate. The test asserts the **contract**, not the key: the env a chart ships must resolve to a mode that permits memory writes, and the two co-hosts may not disagree. Against the charts as they stood during the incident it fails with `assert 'off' == 'write'`. ## Failure class This reopens an existing class. Its prevention artifact, `test_conversation_notes_v2_beta_rollout.py`, pins three named flags across backend-listen and the Cloud Run backend. It does not generalize to other flags, and it does not know the pusher is now a third host of `process_conversation`. Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path ## Deliberately not in this PR - **The other 49 missing env vars**, including `GEMINI_API_KEY`, `USE_VERTEX_AI`, `LISTEN_FINALIZATION_ORPHAN_STALE_SECONDS` and the `FAIR_USE_*` set. Real exposure, but several are secret refs and widening them under incident pressure risks the #12298 class. Needs its own change. - **`LegalHoldAuthorityUnavailable`** (10.5% of failures) — `current_destructive_operation_token()` at `backend/database/legal_holds.py:403`, reached from `canonical_memory_adapter.py:2029`, requires an active `destructive_operation_gate(...)` context that this call site never enters. Introduced by #12084, first seen in prod 2026-08-28T01:51:36Z and firing continuously for ~2.5 days on `/v1/conversations/from-segments`. Independent of this bug and of today's deploy. - **`/v1/embeddings` 404s at the LLM gateway.** `prod-omi-llm-gateway` runs image `c61d815` (2026-08-20), which predates #12337's gateway embeddings route; `gcp_llm_gateway.yml` is dispatch-only and was never run after that merge. Swallowed at `vector_db.py`, so not user-visible as an error — but `save_structured_vector` has been failing silently since ~13:44Z, meaning **no conversation created since then has a summary vector in Pinecone**, and it will not self-heal without a backfill. Fix is to deploy the gateway, not to change code. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/12443?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="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
pull Bot
pushed a commit
to codingwatching/omi
that referenced
this pull request
Aug 31, 2026
…equires Every conversation stopped finalizing in prod at 2026-08-30T15:21:42Z. The pusher had not deployed since 2026-07-01; BasedHardware#12429 fixed the pre-Helm capacity gate blocking the lane, and the 15:16:28Z rollout brought two months of code onto a Deployment whose env was never extended to match. The pusher chart ships 68 env vars where backend-listen ships 115, and MEMORY_ENABLED is among the 50 it lacks. rollout_mode_env_value() fail-closes to `off` when the flag is unset, so MemoryService.ensure_canonical_mutation_ready() -- called unconditionally by _extract_memories_inner for every non-discarded conversation -- raised HTTPException(503). finalizer.py catches it and logs only type(error).__name__, so prod showed ~16k/hour of bare `error=HTTPException` carrying no status, no detail and no traceback, which is why the signature looked already-known and nothing paged on it. Set MEMORY_ENABLED=on for dev and prod pusher, matching backend-listen. It is a plain literal, so it needs no key from the pusher ExternalSecret. The test asserts the contract rather than the key: the env the chart ships must resolve to a mode that permits memory writes. It fails with `assert 'off' == 'write'` against the charts as they stood during the incident. This reopens FC-rollout-flag-absent-from-a-cohost-of-its-code-path. Its prevention artifact, test_conversation_notes_v2_beta_rollout.py, pins three named flags across backend-listen and Cloud Run backend; it does not generalize to other flags or to the pusher as a third host of process_conversation. The remaining 49-var gap between the two charts is real and not addressed here; widening it under incident pressure risks the ExternalSecret failure class from BasedHardware#12298. Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path Co-Authored-By: Claude Opus 5 <[email protected]>
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.
Fixes #11245.
Summary
The live Pusher capacity gate has been failing both deploy lanes on a condition that is not a capacity shortage. It asked whether every surge pod fits on one already-Ready node. Two things are wrong with that question.
Kubernetes never makes a rollout's surge pods share a node. The scheduler places them independently, so requiring the aggregate on a single node is stricter than the thing it is modelling.
A node pool below its autoscaler maximum can still supply the room. The autoscaler provisions a node when a pod is Pending — but this gate runs before Helm, so no Pending pod ever exists for it to react to. The pool is never asked, and its remaining growth is invisible to the check. That is the deadlock #11245 describes for dev, where the lane has been red since 2026-08-05.
Prod is the same shape, and worse:
pusher-pool-v3runs 6 nodes of a maximum 50, each with about 150m CPU and 3.2Gi free, whilemaxSurge: 2at 700m/4.5Gi asks for 1400m and 9.66Gi on one node. Ann4-highmem-2has 1930m allocatable, so after the DaemonSets no node of that pool can ever hold both surge pods. The prod lane was not intermittently unlucky; it was permanently red.What changed
capacity_evidencenow models placement the way the cluster behaves:Growth comes from the
kube-system/cluster-autoscaler-statusConfigMap, which GKE already publishes with each group'smaxSizeand registered node count. No new credential, CLI, or workflow input.The gate stays closed on exactly what it was written to catch: nothing placeable anywhere, a pool already at its maximum, a pool whose empty nodes are too small for the request, and a cluster that publishes no autoscaler status at all (treated as "cannot grow").
Verification
Run against the live prod cluster, read-only, with the digest the failing deploy was carrying:
The same command on
mainproduces the failure that killed runs 33314737324 and 33316563662:insufficient schedulable Pusher headroom … need 1400m CPU and 9663676416 bytes memory for 2 surge pod(s). The evidence line is deliberately explicit that both pods come from growth rather than existing headroom.Measured on that cluster while diagnosing, for the record:
Pool: 6 nodes, autoscaler max 50. An empty
n4-highmem-2(1930m / 12.9Gi) fits both.backend/tests/unit/test_verify_pusher_live_deployment_gate.py: 14 passed, six of them new — spread placement across two nodes, growth supplying full nodes, and fail-closed for pool-at-max, fresh-node-too-small, absent autoscaler status, and unparseable status.test_pusher_deployment_control_workflow.pyalso passes (20 together).Two pre-existing assertions changed: they asserted
fitting_nodes, a count of nodes that could each hold the whole surge wave, which no longer exists as a concept. Both now assertplaced_on_existing_nodes, and both still assert the same pass/fail outcome they did before — the first still passes with room on one node, the second still fails closed when a node can hold only one of two pods. The rewrite renames the evidence, it does not relax the guard.Not verified: I did not run a real deploy. That needs the prod approval gate and is the next step after this merges.
Not in this PR
#11245 also asks for a break-glass on the dev auto-deploy lane, which has no
workflow_dispatchat all. The prod lane already hasskip_live_capacity_gate. That is a workflow change with its own review surface, so it stays separate — this PR removes the reason to need it.Failure class
Failure-Class: none