Pod restarts under Finder WebDAV traffic (interop #2 blocker) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observed 2026-07-20 during first dogfood deployment (k3s, 192.168.10.247):
/davvia ⌘K: repeated disconnects, eventually browsed files and created one folder, then stalled with Finder error 100060 (timeout).dial tcp 192.168.10.247:80: connect: connection refused— service down while pod was in CrashLoopBackOff, so no independent signal.Not yet collected (first step next session):
kubectl describe pod -n cairn <pod>→ Last State reason (OOMKilled? Error + exit code? Liveness probe failure events?)kubectl logs -n cairn deploy/cairn --previous→ panic stack traces /http: panic servinglines vs clean SIGTERM shutdown log (a "shutting down / reason=signal" line means k8s killed us via probe, not a crash)k3s/cairn/deployment.yamlin homelab-configRanked hypotheses:
--previousending in a clean graceful-shutdown line + probe-failure events in describe would confirm. Fix: probe tuning via GitOps.internal/davtriggered by a Finder request pattern (PROPFIND variants, LOCK,._*AppleDouble PUTs, Range) —net/httprecovers per-connection panics without killing the process, so this alone shouldn't restart the pod, but stack traces in previous logs would make it a straight code fix + regression test.Hardening to do regardless of root cause:
http.Servercurrently sets onlyReadHeaderTimeout; add saneReadTimeout/WriteTimeout/IdleTimeoutappropriate for large WebDAV transfers, and consider logging recovered handler panics via a recovery middleware so they surface in slog instead of stderr noise.Diagnosed — root cause found and fixed in PR #6 (CI green).
Evidence (live pod, 2026-07-20, via read-only k8s access):
lastState.terminated: OOMKilled, exit 137, restartCount 6, each life ~3 min, dying at Finder mount timeRoot cause: each argon2id verification allocates its full 64 MiB memory parameter (
m=65536per RFC 9106).Local.Authenticateran verifications unbounded, and Finder's mount storm presents identical Basic credentials on many parallel connections before the verified-credentials cache is warm → N×64 MiB concurrent allocations → cgroup OOM. The dummy-hash anti-enumeration path made even unauthenticated storms an OOM vector.Fix (PR #6, stdlib-only): inflight dedupe of identical concurrent verifications (storm collapses to one argon2 run) + semaphore capping distinct concurrent runs at 2 (~128 MiB worst case). Plus Step-3 hardening:
IdleTimeout: 120s, outermost slog panic-recovery middleware, and a firstinternal/davtest batch covering Finder request shapes. Regression tests included (16-way credential storm etc.).No manifest change needed — existing 256Mi limit is now comfortable.
Remaining to close: merge #6, rebuild/push image
v0.0.2, bump tag in homelab-configk3s/cairn/deployment.yaml, rerun Finder/rclone/Cyberduck interop withkubectl get pods -n cairn -wcorrelating.Retest passed — closing.
v0.0.2 deployed via the new tag-triggered release workflow (ko, built and pushed from the Forgejo runner — no more manual buildx) and rolled out through GitOps. Finder interop retest against the live instance:
http://192.168.10.247/dav: connected first try, no disconnects._*probes), MKCOL + rename (retest-v002), file copy (LOCK/PUT/GET/UNLOCK round-trip, 8.7KB rtf) — all clean in the request log, 0–11msRemaining interop (rclone, Cyberduck) can ride along whenever; the OOM class is fixed. Follow-ups tracked separately:
CairnDownalert rule, Argo webhook for homelab-config didn't fire during the rollout (sync happened via the 3-min poll — worth checking the webhook config).