ci / lint the workflow and the shell (push) Failing after 54s
ci / build, test, smoke (push) Successful in 6m4s
ci / the operator page in a real browser (push) Failing after 4m53s
ci / build the image and smoke it (push) Failing after 10m29s
ci / the same smoke on an image with no base (push) Failing after 9m2s
Measured on this tree with scripts/aot-probe.sh (osx-arm64, a 49,609,680-byte native binary, 10 IL warnings, 0 errors): the AOT edge reaches "Now listening on:", creates its 12 tables from the DDL it carries, proxies a request to the upstream for 200, and its own --healthcheck mode exits 0. The API wall that stood between the first cut and a serving edge came down in two edits, and the json-refusal count went 55 -> 1 -> 0. The 55 were one shape. The anonymous 8-property /healthz literal had no compiled contract, so the edge was serving traffic while the endpoint a scratch container's HEALTHCHECK asks answered 500 - an edge that serves and is restarted anyway. Health/HealthDtos.cs names it (HealthDto, ReadinessDto). The 1 after that was Microsoft.AspNetCore.Mvc.ProblemDetails, the body Results.Problem writes and nobody's DTO in this project: its visible cost was a /readyz 500 naming nothing where a 503 naming the failure is the truth. It now says "Query wasn't precompiled and dynamic code isn't supported with NativeAOT." The probe's scoreboard is split the way the finding is. Three assertions that need no query are gated (healthz 200, proxy 200, --healthcheck exit 0), and the host must be listening with no response refused for want of a contract. Five that do need a query are recorded with the answer a working edge would give - operator block 503 where 204 is right, the streak ban never forms, /readyz 503 where 200 is right - and any of them that ever matches prints MOVED, which is the signal that the query wall moved. queries refused at run time: 32 in that window, 30 in the run before it; it counts a window, not a total, because the background refresh loop retries on its own clock. Two probe bugs surfaced doing this. It sent "Authorization: Bearer" to the admin API, which AdminAuth does not read, so three of its assertions were measuring a 401 rather than the query wall; and it asserted nothing about whether the host had listened at all. Gates on this tree: build 0 warnings, unit 378/378, integration 408/408 in 51 s (the new one demands a contract for ProblemDetails and ValidationProblemDetails), smoke 256/256. Two stale figures corrected rather than left standing. The registered-type count was 24 in README and ARCHITECTURE while the file at that commit holds 25 - CountrySummaryDto arrived without the count being re-derived - and it is 29 now. The anonymous-literal count is 29 in 23 shapes: 22 response shapes, and 7 inside an EF query's Select, which belong to the query wall rather than this one. The "48.8 MB" native binary in ARCHITECTURE matches no measured binary of this tree.
36 lines
1.7 KiB
C#
36 lines
1.7 KiB
C#
namespace OpenWaf.Edge.Health;
|
|
|
|
/// <summary>
|
|
/// What <c>/healthz</c> says. A named record rather than an anonymous literal for
|
|
/// one measured reason: this was the last response shape on the edge that had no
|
|
/// compiled JSON contract, and it is the shape the container's own HEALTHCHECK
|
|
/// asks. Measured 2026-10-07 on the NativeAOT binary — the host started, listened
|
|
/// and proxied traffic, and then answered 500 on every single <c>/healthz</c>
|
|
/// with <c>JsonTypeInfo metadata for type '<>f__AnonymousType52`8[…]' was not
|
|
/// provided by TypeInfoResolver</c>: 55 refusals in one probe window, all of them
|
|
/// this one shape. So the AOT edge was alive and its liveness probe was the thing
|
|
/// that could not read it — which in a scratch container means an edge that serves
|
|
/// traffic and is restarted anyway.
|
|
///
|
|
/// The property names are the wire contract the console, the smoke gate and the
|
|
/// readiness assertions already read; <c>EdgeJson</c>'s camelCase policy turns
|
|
/// these into exactly the JSON the anonymous literal produced, so this changes no
|
|
/// byte on any build.
|
|
/// </summary>
|
|
internal sealed record HealthDto(
|
|
string Status,
|
|
string Mode,
|
|
double SnapshotAgeSeconds,
|
|
double SnapshotTtlSeconds,
|
|
bool GeoLoaded,
|
|
string? GeoDatabase,
|
|
DateTimeOffset? GeoBuiltAt,
|
|
bool GeoStale);
|
|
|
|
/// <summary>What <c>/readyz</c> says when it has nothing to complain about. Named
|
|
/// for the same reason as <see cref="HealthDto"/>: a shape with no compiled
|
|
/// contract is a shape a NativeAOT build cannot serialise, and this one sits on
|
|
/// the endpoint an orchestrator uses to decide whether the edge stays in
|
|
/// rotation.</summary>
|
|
internal sealed record ReadinessDto(string Status);
|