Skip to content

fix(service): show a state record the Service could not write - #4128

Merged
dan-petty merged 5 commits into
mainfrom
fix/4048-state-unkept-gauge
Nov 8, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/4048-state-unkept-gauge

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The roadmap Service keeps three records on its volume: the request budget, the halt and the failure ledger. When a write fails, keep_state_record writes one error log line and the Service goes on with memory only (#2474). Nothing else shows the fault. A restart then loses what the record held: the budget window, a halt after a refused identity, or the suspended jobs (#4048). The log line stays. This change adds a gauge and an alert, so a person sees the fault without a log search.

Closes #4048

Change: openspec/changes/archive/2026-11-08-4048-state-unkept-gauge/
Elapsed: 5.36s

Plan #4048 and add the tests of the gauge devops_cli_service_state_unkept and of the alert RoadmapServiceStateUnkept. The tests fail on the base.
Set the gauge devops_cli_service_state_unkept by record in keep_state_record,
add the alert RoadmapServiceStateUnkept and document both.
@dan-petty dan-petty added type/bug Defect, regression, or incorrect runtime behavior scope/service The long-running devops Service and its lanes labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record for #4048.

fail-to-pass (devops ci fail-to-pass --base origin/main): 12 tests failed on base, 0 errored. The new file tests/server/test_service_state_unkept.py (10 tests) and the alert tests fail on base because the gauge and the alert are absent. They pass on this branch. Log: .data/agent/scratch/4048-f2p.txt.

Full devops ci (run in the verify stage, before a rebase and a dashboard fix): all rows passed, 21161 tests passed, 2 skipped. One failure was caused by this change: tests/grafana/test_grafana_dashboards.py needs a dashboard panel for each CONST_SERVICE_METRIC_ name. It is fixed at the cause with the panel "Service Unkept State Records". The test row took 12m 37s, over 5 minutes (known #3593; the promtool alert test takes 134 s). After the fix and the rebase onto origin/main, these narrow runs pass: test_service_state_unkept (10), dashboards (69), alerting with promtool (59). devops docs generate --check is clean. The full CI was not run again after the rebase.

Rollout rule. This change adds one gauge (devops_cli_service_state_unkept, label record), one alert (RoadmapServiceStateUnkept) and one dashboard panel. It removes, renames or tightens no setting. k8s/devops/configmap.example.yaml and the live ConfigMap stay as they are. tests/config/test_k8s_devops_runtime.py already loads the example ConfigMap into Settings, so no new test is needed. Nothing was applied to the cluster. The Argo CD sync of k8s/monitoring/prometheus-values.yaml after the merge adds the alert.

Note. The gauge is in process memory. A restart clears it, and the next failed write sets it again.

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 04:19
@dan-petty
dan-petty merged commit cd2ebda into main Nov 8, 2026
25 checks passed
@dan-petty
dan-petty deleted the fix/4048-state-unkept-gauge branch November 8, 2026 04:25
dan-petty pushed a commit that referenced this pull request Nov 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.87.2](v0.87.1...v0.87.2)
(2026-11-08)


### Bug Fixes

* **k8s:** check example ConfigMap keys are settings
([7935fba](7935fba))
* **k8s:** check example ConfigMap keys are settings
([#4134](#4134))
([7935fba](7935fba))
* **roadmap:** write the body with the marks in one request
([#4130](#4130))
([9504170](9504170))
* **service:** show a state record the Service could not write
([#4128](#4128))
([cd2ebda](cd2ebda)),
closes [#4048](#4048)


### Code Refactoring

* **roadmap:** type the stage planner request
([#4124](#4124))
([d83491e](d83491e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/service The long-running devops Service and its lanes type/bug Defect, regression, or incorrect runtime behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(service): show a state record that the Service could not write

1 participant