Repository navigation
fix(infra): keep servers up through the drain window - #36
Merged
Merged
Conversation
Echo's StartConfig.Start shuts the server down as soon as its context is canceled, and both servers were started on the signal context. SIGTERM therefore closed the API and infra ports immediately: for the whole drain window the proxy saw refused connections instead of /readiness 503, and in-flight requests were cut before the drain had any effect. Start both servers on context.WithoutCancel(ctx) so they keep serving until the closer calls Stop after the drain wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ruko1202
force-pushed
the
fix/drain-keeps-servers-up
branch
from
November 3, 2026 19:47
5d289bc to
575cbb6
Compare
go1.26.10 fixes GO-2026-6809 (crypto/x509 distrusts compromised intermediate certificates), which govulncheck reports as reachable and which fails the vulnerability scan on every branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Graceful drain did not work: on SIGTERM the API and infra ports closed immediately, so for the whole drain window (6s) the proxy saw a refused connection instead of
/readiness503, and in-flight requests were cut off before the drain had any effect.Cause: Echo's
StartConfig.Start(ctx, …)shuts the server down as soon asctxis canceled, and both servers were started with the signal context fromsignal.NotifyContext. The xhttpStopregistered in the closer never got the chance to be the one that stops them.Fix: start both servers on
context.WithoutCancel(ctx). They now keep serving untilcloser.CloseAllcallsStopafter the drain wait, which is the orderingshutdown()already documents.Also: Go toolchain go1.26.9 → go1.26.10
The vulnerability scan started failing on every branch: govulncheck reports GO-2026-6809 (
crypto/x509, fixed in go1.26.10) as reachable. The toolchain is pinned only ingo.mod(CI reads it viago-version-file). govulncheck is clean on this branch after the bump.Testing
Ran the binary locally and polled during shutdown:
/readinessduring drain/livenessduring drainmake lint: 0 issues. Rebased onto main after #35 was merged.🤖 Generated with Claude Code