Repository navigation
fix(kind): the probe waited on a static literal, and failed with a traceback - #614
Merged
Merged
Conversation
…aceback
The nightly kind probe went red on 2026-11-05 (run 41982655419) in phase 1,
and the only evidence in the log was this:
File "<string>", line 1, in <module>
import json,sys; print(json.load(sys.stdin)["id"])
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
That is `enqueue()`'s parse dying on empty stdin. It names neither the request
nor the status — the two facts that distinguish "the API refused this" from
"the port-forward died" — so the failure was not diagnosable from its own log.
Two separate problems, one of which is the likely cause.
**The startup gate waited on `/healthz`, which cannot say no.** It is a static
literal — `Json(json!({ "status": "ok" }))` — so it answers 200 while Postgres
is unreachable and the process cannot serve a single DB-backed request.
`/readyz` is the real signal, takes `State` and actually checks the DSN, and is
what the chart's readiness and startup probes have read since PR1. The probe
was the one caller still trusting the literal.
That fits the observed timeline exactly: the org POST landed at 07:28:25, the
very next job POST got nothing for ten seconds, and the probe had already
decided the API was up. Now 90 ticks rather than 30, because `readyz`
legitimately stays red through `ensure_schema` on a cold boot — which is the
whole reason to wait for it rather than for the literal.
**`api()` now reports before it fails.** Its comment used to say "a real
4xx/5xx still fails fast because the body is empty on every attempt and the
caller's parse dies", which was true and a bad trade: `curl -fsS` prints no
body on a 4xx/5xx, so the status and the `detail` — the whole diagnosis — were
discarded and the caller's traceback was all that survived. It now re-asks once
without `-f`, purely to report, and names the method, path, status and body:
check_kind: POST /v1/orgs/x/jobs gave up after 5 tries — HTTP 404: {"detail":"no such org"}
check_kind: POST /v1/orgs/x/jobs gave up after 5 tries — HTTP 000 (no HTTP response — port-forward or pod gone):
Both messages above are copied from real runs against a local 404 server and a
closed port, not composed by hand — and that is how the one bug in this change
was found. The first version wrote `|| echo "000"`, which appended a second
`000` on exactly the failure it was meant to label: the message read
`HTTP 000000`, and because the equality test no longer matched, the
parenthetical explaining what 000 means never fired. Reasoning about it would
not have caught that; running it against a closed port did.
No behaviour change on the happy path: same five attempts, same early return,
the extra request only ever runs when the probe is already failing.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Nov 5, 2026
athvin
pushed a commit
that referenced
this pull request
Nov 8, 2026
…tory The header's premise — never observed failing, so not trusted — went stale: the probe failed four times for four distinct causes (#614, #622, #624, #610) and has now passed twice on main (2026-11-07 nightly 42348330935, 2026-11-08 dispatch 42447724542, all six phases both times). The decision stands, restated on cost grounds: the in-job release-image build is the wrong price for a PR gate and the per-PR assertions job covers the cheap half. The timeout comment gains the measured end-to-end timings (28m42s, 33m51s of the 120 budget) that settle #655's step 2 without a raise.
athvin
added a commit
that referenced
this pull request
Nov 8, 2026
…tory (#655) * wip: claim #655 — first green kind probe run * docs(kind): restate the probe's not-required decision on observed history The header's premise — never observed failing, so not trusted — went stale: the probe failed four times for four distinct causes (#614, #622, #624, #610) and has now passed twice on main (2026-11-07 nightly 42348330935, 2026-11-08 dispatch 42447724542, all six phases both times). The decision stands, restated on cost grounds: the in-job release-image build is the wrong price for a PR gate and the per-PR assertions job covers the cheap half. The timeout comment gains the measured end-to-end timings (28m42s, 33m51s of the 120 budget) that settle #655's step 2 without a raise. --------- Co-authored-by: bmoore813 <[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.
The nightly kind probe went red on 2026-11-05 (run 41982655419) in phase 1, and the only evidence in the log was this:
That is
enqueue()'s parse dying on empty stdin. It names neither the request nor the status — the two facts that distinguish "the API refused this" from "the port-forward died" — so the failure was not diagnosable from its own log. Two separate problems, one of which is the likely cause.The startup gate waited on
/healthz, which cannot say no/healthzis a static literal —Json(json!({ "status": "ok" })), with a doc comment explaining that a liveness probe must not fail on a dependency outage. So it answers 200 while Postgres is unreachable and the process cannot serve a single DB-backed request./readyzis the real signal: it takesState, checks the DSN, and is what the chart's readiness and startup probes have read since PR1. The probe was the one caller still trusting the literal.That fits the observed timeline exactly:
org kindacme registered— the org POST landedphase 1: the green pathThe probe had already decided the API was up, on the strength of a constant. Now 90 ticks rather than 30, because
readyzlegitimately stays red throughensure_schemaon a cold boot — which is the whole reason to wait for it rather than the literal.api()now reports before it failsIts comment used to say "a real 4xx/5xx still fails fast because the body is empty on every attempt and the caller's parse dies" — true, and a bad trade.
curl -fsSprints no body on a 4xx/5xx, so the status and thedetailwere discarded and the caller's traceback was all that survived.It now re-asks once without
-f, purely to report:The bug that only running it would find
Both messages above are copied from real runs against a local 404 server and a closed port, not composed by hand — and that is how the one bug in this change surfaced.
The first version wrote
|| echo "000". Butcurl -w '%{http_code}'already prints000on a connection failure while exiting non-zero, so the fallback appended a second one. On exactly the failure it was meant to label, the message readHTTP 000000— and because[ "$code" = "000" ]no longer matched, the parenthetical explaining what000means never fired. Reasoning about it would not have caught that.Scope
No behaviour change on the happy path: same five attempts, same early return. The extra request only ever runs when the probe is already failing. Verified with
bash -nand by exercising all three paths (404-with-body, dead port with a body arg, dead port without one).This is deliberately separate from #610 so that PR's in-flight verification run stays valid —
check_kind.shis byte-identical there to the commit its probe run was dispatched against.🤖 Generated with Claude Code