Skip to content

fix: keep the prod record-seal worker idle and scrapeable - #24931

Merged
Git-on-my-level merged 2 commits into
mainfrom
fix/record-seal-worker-idle-scrape
Nov 8, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
fix/record-seal-worker-idle-scrape

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

The prod record-seal-worker is idle by design while record-seal-repair is the only repair IO path. At 2026-11-08 ~13:35Z the lane measured one Error pod with 68 restarts in ~8h, logging record_seal_worker/outcome=error/stage=policy before exiting 1. Readback at 13:41:42Z (ro-prod) found the pod not Ready with 69 restarts; GMP at 13:42:25Z returned 0 for the record-seal-worker job selection; at 13:48:30Z the exact job="record-seal-worker" selector confirmed one down target. Repair remains unsuspended (last success 13:21:38Z).

Set only prod recordSealWorker.runtimeEnabled: false. The existing runtime kill switch skips policy validation and worker/client construction while serving /metrics on 8080. Keep worker serverFlags: {} (IO refused), Deployment/HPA/PodMonitoring, and the repair CronJob unchanged. No application code or production apply.

Consumer check: the HPA targets external omi_record_seal_backlog at 4 rows/worker; the adapter accepts only samples refreshed within 60s. An idle worker exports backlog/oldest as NaN and freshness 0, so the adapter remains unavailable rather than reporting a false empty queue; missing metrics block scale-down. This was already unavailable during the crashloop. The runbook explicitly documents this idle-worker/active-cron rollback. Monitoring has a presence-gated local record-seal-worker-metrics down/empty alert and a separate GMP PodMonitoring; no dashboard or alert consumes this worker's backlog/oldest series. omi_record_seal_nojob_* alerts are separate sweeper observations. This fixes target availability, not backlog measurement.

Expected readback after the next authorized batch-pipeline-worker Helm roll: new pod Ready, 0 restarts over the observation window, HTTP 200 /metrics on 8080, and GMP up{job="record-seal-worker"} == 1. Worker IO stays refused: runtime false, empty policy, no scanner/Firestore row claims. The local Prometheus job is named record-seal-worker-metrics; verify its up/sample counts too. Repair stays unsuspended and continues completing. These are expected outcomes, not deployed results from this PR.

Rollback: revert the prod runtime value to runtimeEnabled: true (or remove the added recordSealWorker override block) and roll the chart; the chart default true restores the prior crashloop with an empty policy. Do not enable worker IO alongside repair.

Validation: offline Helm chart/values and worker contracts via /Users/dazheng/workspace/omi/bin/omi-heavy run -- backend/.venv/bin/python -m pytest -q backend/tests/unit/test_record_seal_worker_deploy.py backend/tests/unit/test_batch_pipeline_chart.py backend/tests/unit/test_record_seal_cluster_repair_deploy.py backend/tests/unit/test_record_seal_sweeper_deploy.py backend/tests/unit/test_record_seal_worker_guards.py backend/tests/unit/test_record_seal_worker.py; 155 passed, one existing audioop deprecation warning (53.57s). A separate local smoke exercised worker.run with the rendered runtime setting and a real loopback HTTP server: /metrics 200, NaN backlog/oldest, freshness 0, no worker construction or policy validation, clean HTTP shutdown. After the final explicit-ON overlap fixture adjustment, the worker deploy suite was rerun: 7 passed in 29.88s. Rendered before/after differs only in worker Deployment; chart contract pins readiness, scrape endpoint, runtime off, policy empty and repair enabled.

Repository preflight: omi-heavy run -- env OMI_PR_BODY_FILE=<this file> make preflight passed 37 checks in 1037.88s on the committed clean tree (2026-11-08 14:08:35Z).

The first pre-push attempt passed shared preflight and Pyright (0 errors) but two broad, unchanged contract files hit the 300s per-file wall limit without assertion failures. The complete pre-push hook then passed unchanged on 2026-11-08 (observed 15:23:47Z), including all 24 selected unit files, with invocation-only BACKEND_UNIT_FILE_BUDGET_SECONDS=900 BACKEND_PYTEST_WORKERS=1, retaining the runner and CPU timing guard; no tests or gates were disabled.

Product invariants affected

none (deployment configuration and its chart contract; no lifecycle/proof behavior changes).

Failure-Class: none

Failure class narrative: config drift: idle-by-design worker crash-loops on refused policy. No matching registered semantic class was found; registry changes under .github/ are outside this task. The existing shared runtime kill switch is the prevention primitive; no new guard or application fallback is introduced.

View guided diff Turn on auto-fix

Use the existing runtime switch while repair remains the only IO path.
Preserve readiness, monitoring and the repair CronJob in rendered contracts.

Failure-Class: config drift: idle-by-design worker crash-loops on refused policy
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-08T15:28:41.906544Z 8b69d2e PR opened
ℹ️ 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Assert equal resource keys before comparing documents so a resource present
only in the running render fails the Deployment-only contract clearly.

Failure-Class: test contract: asymmetric render comparison misses added resources
@Git-on-my-level
Git-on-my-level merged commit a7c3522 into main Nov 8, 2026
58 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/record-seal-worker-idle-scrape branch November 8, 2026 23:42
Git-on-my-level added a commit that referenced this pull request Nov 10, 2026
## Problem and change

GMP pusher had 25 targets and `sum(up)=0` at both 2026-11-08 13:45Z and
13:56Z (scope investigation, not a new measurement in this
implementation). The pusher scrape gap remains all-down: cl2-fixnow
reports a newer verification at **2026-11-09 00:10Z of 19 targets, 0
up**. The earlier count was 25 targets, 0 up; the target count changed,
while scrape availability remained zero. This implementation did not
independently remeasure production. The authenticated PodMonitoring was
shipped without its app-namespace scrape Secret and collector RBAC
prerequisites. The missing RBAC was measured; Secret absence and the
exact scrape error were inferred because read-only access cannot inspect
Secrets or per-target errors.

## ACCESS CHANGE — approval required

**ACCESS CHANGE: new secret copy in the app namespace + RBAC for the
Google-managed collector. David's approval is required before merge. Do
not merge or deploy before that approval.**

- Sync `metrics-scrape-token` key `token` through the existing
backend-secrets SecretStore in both `prod-omi-backend` and
`dev-omi-backend`. Derive its remote key from the existing app
`METRICS_SECRET` mapping (currently remote key `METRICS_SECRET` in both
stages), with the existing refresh interval and Owner policy.
- Each pusher/listen release owns its own Role/RoleBinding for
`gmp-system/collector`, limited to `get/list/watch` on the named
`metrics-scrape-token` Secret. Render both only when
`podMonitoring.enabled` is true.
- Pin dev/prod renders, source-key linkage, RBAC scope and
monitoring-disabled behavior in Helm render regression tests. App
`/metrics` token enforcement remains unchanged.

The record-seal-worker scrape was fixed separately in
[#24931](#24931); that
independent fix is not part of this PR.

## Required deployment sequence after approval

1. **backend-secrets first**, for each environment: apply the updated
chart through `backend/scripts/deploy-backend-secrets.sh` in its
approved deploy context. Wait separately for ExternalSecret
`metrics-scrape-token-store` Ready and confirm the target Secret has key
`token` without printing its value. The helper currently
waits/force-syncs only the existing app ExternalSecret; its success does
not establish readiness of the new token copy.
2. **Pusher chart next**: roll pusher, or Helm-upgrade its chart while
retaining the running image/digest and existing release overrides, to
apply its Role/RoleBinding. Standalone
`.github/workflows/gcp_backend_pusher.yml` does not apply
backend-secrets; only its optional LLM Gateway branch calls
`deploy-llm-gateway.sh`, which applies secrets first. Development
auto-pusher also upgrades only pusher. A pusher-only roll cannot supply
the Secret.
3. **Listen with its operator-approved 22:00Z roll**: apply the updated
backend-listen chart and its Role/RoleBinding.
`.github/workflows/gcp_backend_listen_helm.yml` has `Upgrade
backend-secrets Helm chart` immediately before `Upgrade backend-listen
Helm chart`. The full backend workflow (`gcp_backend.yml` ->
`.github/actions/deploy-backend-stack/action.yml`) also applies
backend-secrets before listen when `deploy_targets=all`; Cloud Run-only
does not reach this step. The listen-chart main-push trigger defaults to
development; the 22:00Z prod roll remains an operator-planned action,
not a schedule added by this PR.
4. Verify nonzero target counts plus `sum(up{job="prod-omi-pusher"}) ==
count(up{job="prod-omi-pusher"})`. After listen's roll require
`sum(up{job="prod-omi-backend-listen"}) ==
count(up{job="prod-omi-backend-listen"})`. Also require
`pusher_active_ws_connections` / `backend_listen_active_ws_connections`
series under their respective GMP job names. Use the analogous dev jobs
in dev; dev runtime health was not measured by this task.

This PR applies no live resources and dispatches no workflows.

## Rollback

Revert and reapply the three charts to remove the new token copy and
access, or set `podMonitoring.enabled=false` on pusher/listen and
upgrade them to remove the monitors and collector RBAC. Disabling
monitoring leaves the separately managed token copy in place.

## Validation

- `omi-heavy run -- backend/.venv/bin/python -m pytest -q
backend/tests/unit/test_serving_podmonitoring_chart.py
backend/tests/unit/test_backend_secrets_chart.py`: 8 passed, 3.11s after
merging current main (2026-11-09T01:37:36Z; head
`6f526c62fdb26966f01d0bff4f91c4fd6402da57`).
- Dev/prod `helm lint` for backend-secrets, pusher and backend-listen:
all six passed; strict lint with synthetic image settings also passed
6/6 (2026-11-08T14:31:30Z).
- Fresh guarded-push preflight: **43 checks passed in 313.87s**,
followed by the selected **38 backend test files** and the complete
bounded pre-push gate. Push completed successfully (log timestamp
2026-11-09T01:44:53Z; verified at 01:45:54Z).

Previous publication blockers are fixed on main:
[#24948](#24948) scopes the
Parakeet cleanup timeout to its receiver task, and
[#24950](#24950) repairs the
dated flag-registry gate. This branch merged current `origin/main`
without rebasing and includes both fixes. Fresh render validation and
the full guarded push passed with `TZ=UTC` and
`BACKEND_UNIT_FILE_BUDGET_SECONDS=900`; no tests or hooks were skipped.
The remote branch matches head
`6f526c62fdb26966f01d0bff4f91c4fd6402da57`. GitHub CI is separate from
these local checks.

No production/data reads in this implementation; no GCP tier used. Local
render checks do not establish live GMP recovery.

## Product invariants affected

none

Failure-Class: none

Failure mechanism: deploy gap — PodMonitoring shipped without its auth
prerequisites. No registered failure class directly covers this
access-prerequisite omission; this PR adds behavioral render guards
without editing the failure-class registry.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/24961?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/24961?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F24961&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. -->
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