Skip to content

Gateway profiles: validate the stack instead of the standalone, fix authsvc on Rust 1.100, unbreak the aspnet gateway entries - #1767

Merged
MDA2AV merged 3 commits into
mainfrom
fix/gateway-validation
Nov 13, 2026
Merged

MDA2AV merged 3 commits into
mainfrom
fix/gateway-validation

Conversation

@MDA2AV

@MDA2AV MDA2AV commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Three problems kept the gateway and production-stack profiles from measuring what they claim to. Each fix is its own commit.

1. validate.sh checked the standalone server, not the stack (cherry-picked from #1615)

When an entry subscribes to a compose profile, validate.sh runs its standalone container on --network host, and it left that container running while the gateway and production-stack stacks came up on the same host ports. An entry that binds :8080 (or :8443) with SO_REUSEPORT then shares the port with the leftover container, and the kernel hands part of the stack's traffic to the standalone server. An entry without SO_REUSEPORT fails to bind, or loses the port outright. Either way, the gateway checks can pass against a server with no proxy in front of it.

On #1761 this showed up as FAIL [production-stack cache-aside]: first=MISS second=MISS. The standalone morojs has no Redis, so each of its worker threads keeps its own cache. Reproduced locally with two morojs containers in one network namespace: 73 of 100 cache-aside probes came back MISS/MISS. With the stack's server alone, 400 of 400 came back MISS→HIT.

The commit is jbr's 31af2c3 from #1615, unchanged. It stops the standalone with docker stop before the compose profiles; the EXIT trap still removes it. #1615's own validation run already passed with it on fulmine, libuvcpp, morojs, trillium and trillium-tuned. Once this lands, #1615 can rebase down to trillium's production-stack change.

2. authsvc has shipped an empty binary since Rust 1.100

Since the morning of 2026-11-13, every production-stack benchmark has ended before measuring anything (roadrunner-gateway on #1757, morojs on #1761, tako-gateway on #1762): the shared authsvc exits 0 without a word. rust:1-alpine moved to Rust 1.100 on 2026-11-12, and that cargo keeps each package's artifacts under target/release/build/<package>/<hash>/ instead of target/release/deps/. The Dockerfile builds a placeholder fn main() {} to cache the dependencies, then deletes it with rm -rf target/release/deps/authsvc*. That glob no longer matched, so the real build found the placeholder up to date (Finished … in 0.04s) and the image shipped it.

cargo clean --release -p authsvc now removes the placeholder wherever cargo keeps it. A grep for the server's startup line fails the build if the placeholder ever ships again; checked against the placeholder binary, it fails as intended. Built on the current rust:1-alpine (1.100.0): a 1.2 MB binary, authsvc listening on …, /_health 200, /_auth without a token 401.

3. aspnet-minimal_nginx and aspnet-minimal_caddy have not built since July

Their Dockerfiles copy aspnet-minimal's AppData.cs and Models.cs, which #1002 split into Services/ and Types/. They now copy Handlers.cs with Services/ and Types/, and register those services the way aspnet-minimal's Program.cs does. The nginx entry's /api routes use DatabaseService's Postgres pool.

What to expect

Local validation (this branch)

Run with scripts/validate.sh from this branch on a 32-CPU box. The compose files pin cores 64-95 of the bench host, so their cpuset: lines were stripped in a scratch copy for the run; nothing else changed.

Entry Profiles Result
aspnet-minimal_nginx gateway-64, production-stack 27 passed, 0 failed
aspnet-minimal_caddy gateway-h3 12 passed, 0 failed
morojs all 23, with the standalone stopped before the stacks 160 passed, 0 failed

On both production-stack runs authsvc came up healthy, /api/items without a token got 401, and cache-aside went MISS then HIT. That is the check that failed on #1761.

🤖 Generated with Claude Code

jbr and others added 3 commits November 13, 2026 16:33
The standalone container runs on --network host whenever an entry
subscribes to a compose profile, and it was left running while the
gateway and production-stack stacks came up. An entry that also serves
h2/h3 keeps 8443 (and 8080), so the stack's edge failed to bind, shared
the port, or exited on the QUIC port, and the checks reached the
standalone server instead of the stack.
production-stack has failed on the bench host since the morning of
2026-11-13 on every entry (roadrunner-gateway #1757, morojs #1761,
tako-gateway #1762): the shared authsvc container exits 0 with no output,
the edge never sees it healthy, and the run ends with no results.

rust:1-alpine moved to Rust 1.100 on 2026-11-12. Its cargo keeps each
package's artifacts under target/release/build/<package>/<hash>/ rather
than target/release/deps/, so the cache-priming step's
`rm -rf target/release/deps/authsvc*` stopped matching anything. The
placeholder built from `fn main() {}` stayed up to date, the second
`cargo build` finished in 0.04s without compiling src/, and the image
shipped the placeholder: a 418 KB binary that exits 0 at once.

`cargo clean --release -p authsvc` removes the placeholder's artifacts
wherever cargo keeps them, and a grep for the server's startup line fails
the build if the placeholder is ever shipped again. Built against the
current rust:1-alpine (1.100.0): a 1.2 MB binary that logs
"authsvc listening on ...", answers /_health with 200 and an /_auth
without a token with 401.
…mal's Services and Types

Both Dockerfiles still COPY aspnet-minimal's AppData.cs and Models.cs,
which #1002 (2026-07-18) split into Services/ and Types/, so neither image
has built since. They were the only failures in #1615's validation sweep,
and their published results have not been refreshed since July.

Copy Handlers.cs with Services/ and Types/, register DatabaseService,
DatasetService, ItemService and the AppJsonContext resolver the way
aspnet-minimal's Program.cs does, and give the nginx entry's /api routes
DatabaseService's Postgres pool in place of AppData.PgDataSource. The
caddy entry gains the StackExchange.Redis reference DatabaseService needs;
it connects to nothing unless REDIS_URL is set, which gateway-h3 never
does.
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.

2 participants