Sim health check reports WARNING for "just restarted", pageing on every deploy — give Unknown its own tag and a startup grace window
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- java
- Ambito
- observability-sre
Direzione di ricerca
Start in vcell-api/src/main/java/org/vcell/rest/health/HealthService.java: read the NagiosStatus factory methods around :85-95, the healthEvents deque at :103, the loop timing constants at :36-40, and getRunsimStatus at :283-310 to see where Unknown() is returned. Then track service start time and introduce a distinct startup/starting state for now-startTime < SIMULATION_LOOP_START_DELAY + SIMULATION_TIMEOUT, keeping Unknown alertable after that window; the dispatch path is HealthRestlet.java:93. Done when a fresh pod's response body contains no WARNING keyword while a wedged loop still does — note the Better Stack monitor greps the response, so its tag config must change together, and run the vcell-api tests covering health responses.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
GET /api/v0/health?check=sim reports the same WARNING tag for two conditions that mean opposite
things:
- "simulations are degraded" — a real signal
- "this pod started less than ~2 minutes ago and hasn't finished its first test simulation" —
not a signal at all
Better Stack alerts on the literal keyword WARNING in the response body, so a freshly started
api pod pages the on-call. Any deploy, node drain, eviction or reschedule can trigger it.
Mechanism
HealthService keeps its event history in an in-memory deque
(HealthService.java:103):
final ConcurrentLinkedDeque<HealthEvent> healthEvents = new ConcurrentLinkedDeque<>();
A restart empties it. The monitor loop then sleeps before doing anything
(HealthService.java:173, SIMULATION_LOOP_START_DELAY = 60s), submits a test simulation, and
only records RUNSIM_SUCCESS/RUNSIM_FAILED when it finishes. Until then getRunsimStatus
finds nothing in its 15-minute lookback and returns (HealthService.java:309):
if (loginCompleteEvent==null) {
return NagiosStatus.Unknown(); // no completed simulation attempts
}
and Unknown() carries the alerting keyword (HealthService.java:94):
static NagiosStatus Unknown() {
return new NagiosStatus("Unknown", 3, null, null, "WARNING");
}
So the wire response is
{"nagiosStatusName":"Unknown","nagiosStatusCode":3,"tags":"WARNING"}
which is byte-identical whether the pod just booted or the simulation subsystem is broken.
How this showed up
The VCell Release Health - Sim - Warning monitor fired on 2026-08-18 at 2:00:15 PM —
fifteen seconds after the top of the hour. restart-api-cron in prod ran
kubectl -n prod rollout restart deployment/api every hour, so a fresh pod was always
available to be hit just after :00.
It paged only intermittently because the rolling restart leaves older pods (which still have event
history) serving alongside new ones — the check has to land on a fresh pod inside its first ~1–2
minutes.
That cron has since been suspended
(vcell-fluxcd#51) now that
#1899 fixed the memory growth it was mitigating. That removes the frequency, not the defect.
Every deploy still carries the same false-alarm window.
Why Unknown is the wrong tag
The other three statuses are all measurements (HealthService.java:85-95):
| status | code | tags | means |
|---|---|---|---|
OK |
0 | UP |
sim completed under 45 s |
Warning |
1 | UP WARNING |
sim completed, but slower than SIMULATION_TIME_WARNING |
Critical |
2 | DOWN |
sim failed, or exceeded SIMULATION_TIMEOUT |
Unknown |
3 | WARNING |
no measurement exists yet |
Unknown is the only one that is an absence of information, and it is the only one whose tag
does not describe an observed state. Nagios convention agrees: exit code 3 is "cannot determine",
deliberately distinct from 1 "warning".
Proposed fix
Distinguish "not yet known" from "known bad". Two parts, either useful alone:
- Give
Unknownits own tag — e.g.tags: "UNKNOWN"rather than"WARNING"— so a keyword
monitor can choose. This alone fixes the paging, and is a one-line change. - Add a startup grace window. Track service start time; while
now - startTime < SIMULATION_LOOP_START_DELAY + SIMULATION_TIMEOUT, report a distinct
starting state rather than an indeterminate one. After the grace window with still no
completed simulation,Unknownis genuinely worth alerting on — the loop thread may have died,
which today is indistinguishable from a normal boot.
The second point matters and is easy to miss: a permanently wedged monitor thread and a
healthy fresh pod currently produce the same output forever. Fixing (1) without (2) would make
a dead health loop silent.
Also worth considering: persist or seed the event history so a restart does not lose the
picture entirely, though this is a bigger change and may not be worth it for a 3-replica
deployment.
Acceptance
- A pod restart does not produce a response that a
WARNINGkeyword monitor matches. - A health loop that dies, or simulations that stop completing, does still alert after the grace
window. - Better Stack config updated to match whatever tags are chosen — the monitor greps the body, so
the two have to be changed together.
Files
vcell-api/src/main/java/org/vcell/rest/health/HealthService.java—:94Unknown(),
:103event store,:283-310getRunsimStatus,:36-40timing constantsvcell-api/src/main/java/org/vcell/rest/health/HealthRestlet.java:93— thecheck=simdispatch
Refs #1899, virtualcell/vcell-fluxcd#51
- Lingua principale
- Java
- Stelle
- 140
- Fork
- 35
- Merge medio
- 22h 6m
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di virtualcell/vcell
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
virtualcell/vcell#2193 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement Java-based User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
virtualcell/vcell#2138 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement Java-based
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
virtualcell/vcell#2137 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
virtualcell/vcell#2135 ·
I maintainer di solito rispondono entro 1 giorno
-
Accessibility Requirement Java-based User Interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
virtualcell/vcell#2134 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di virtualcell/vcell
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
NationalSecurityAgency/ghidra#10149 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
yegor256/antlr2ebnf-maven-plugin#155 ·
I maintainer di solito rispondono entro 1 giorno
-
account bug exercise lecture programming user interface
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ls1intum/Artemis#14512 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
kind:bug priority:major
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
swiftlang/swift-java#955 ·
I maintainer di solito rispondono entro 1 giorno