Repository navigation
Replies: 2 comments
TriageVerdict: A reproducible bug in the billing walkthrough's kind tests, not in a humus package. A case's cleanup drops its database Is this a misuse of humus?No. No end user's code is involved. The behaviour belongs to the walkthrough's own test harness: the shared cases' The cause is upstream, in containerd 2.x and client-go (see Why). That doesn't make it a misuse. The harness is humus's, and it's what puts the drop right behind the close. A reader can't defend against it either: they run Is it a feature request?No. It breaks these promises:
A fix changes no humus API. The example module isn't released, and the fix is in its tests and scripts. Is it reproducible?Yes. At d4eadda, on kind v0.33.0 ( The new tests are in the
8 workers on containerd 2.3.4: the forward dies at the first drop that terminates a backend. Run 1:
That is the report's signature from CI, step for step. The other three runs went the same way, with steps 2 and 3 within 3 ms of each other each time. 1 worker: nothing to race. With no other load, every containerd 1.7.13: the same reset, and the forward survives. The drops terminated 20 to 28 backends per run, and containerd logged the resets, such as
The report's account holds. One precision about its containerd 1.7 runs: the reset happens there too. containerd 1.7.13 logs it and keeps it off the error stream. Why is below. Why
What else it reaches:
#1178 is filed to fix it:
|
|
Fixed by #1179 (#1179), merged as 443a9ae. A case's cleanup no longer drops its database while its own connection is still closing.
|
Uh oh!
There was an error while loading. Please reload this page.
What happens
The Billing walkthrough (kind) job fails intermittently, on story PRs, in the merge queue and on
main, e.g. run 39378019962. Outside Renovate's runs it failed in 18 of 162 runs since 2026-10-19, about 1 in 9. All 18 have the same signature:unexpected EOF;DROP DATABASE … WITH (FORCE)fails withconn closed;dial tcp 127.0.0.1:<port>: connect: connection refused, so the rest ofTestBilling_passes_the_shared_cases_as_deployed,TestBilling_sends_a_runs_telemetry_to_the_LGTM_stackandTestGrafana_alerts_on_the_billing_job_and_has_its_dashboardfail too.connection refusedon the forwarded port means thekubectl port-forward service/postgresthatdeploy/kind/test.shstarts has exited. The PostgreSQL pod itself is stillRunningwith no restarts.Where only one case was running, the first thing to fail is always the
DROP DATABASE … WITH (FORCE)that comes right after the case closes its own connection to that database:cases.go:254, innewDatabase's cleanups (theconn.Closecleanup runs first, then the drop):TestBilling_sends_a_runs_telemetry_to_the_LGTM_stackin run 39402915366 andTestGrafana_…in run 39412690207;functional_test.go:720, infailingAnInvoice's deferred calls (againconn.Closefirst, then the drop):TestGrafana_…in run 39257723132 and run 39411536440.In the parallel shared cases the forward dies at some case's drop, and the cases still running or yet to start fail after it.
Why
This hasn't been triaged. What follows comes from the logs and a reproduction outside humus.
ClosesendsTerminateand closes its socket without waiting for the server. Through the port-forward, thatTerminatestill has to cross kubectl, the API server, the kubelet and containerd before it reaches the pod. The admin connection'sDROP DATABASE … WITH (FORCE), sent right after, can terminate the closed connection's backend first. PostgreSQL then resets the connection inside the pod.error: lost connection to pod, taking every other forwarded connection with it. This is upstream's kubernetes/kubernetes#111825 (open). kubernetes/kubernetes#143050 (open) would stop one connection's error from closing the session.Reproduction. I deployed
postgres:18.0on kind and ran a small pgx v5.11.0 program throughkubectl port-forward service/postgres :5432. Each of 8 workers loops: connect as admin,CREATE DATABASE, connect to it, create a table and insert a row,Closethat connection, thenDROP DATABASE … WITH (FORCE)on the admin connection. That is the same order as the cases' cleanups.kindest/node:v1.37.0(containerd 2.3.4, as in CI)pg_stat_activityshows no backend on the databasekindest/node:v1.29.2(containerd 1.7)So the race needs some load. CI supplies it: the shared cases run in parallel under
-raceon a 4-CPU runner, next to the LGTM stack. kubectl's log on each death:The program's drop then failed with
conn closed, as in CI.Expected
The kind functional tests pass whenever the deployment works. A case dropping its own database doesn't take down the port-forward the other cases and tests share.
References
connection reset by peerat a proxyAll reactions