fix(backend): bind the HTTP listener before startup recovery so health checks don't crash-loop (#2944)

Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
This commit is contained in:
Henry
2026-08-24 19:35:07 +00:00
committed by GitHub
parent 4b7ea239d4
commit 54d507b8d7
46 changed files with 2237 additions and 324 deletions
@@ -260,25 +260,3 @@ func TestServerListenersStopClosesListenersAndDrains(t *testing.T) {
t.Fatal("expected connection failure on 127.0.0.2 after shutdown")
}
}
func TestProbeAddrPrefersLoopback(t *testing.T) {
sl := &serverListeners{bound: []string{"100.64.0.1:8080", "127.0.0.1:8080"}}
if got := sl.probeAddr(); got != "127.0.0.1:8080" {
t.Fatalf("probeAddr() = %q, want 127.0.0.1:8080", got)
}
wildcard := &serverListeners{bound: []string{"0.0.0.0:8080"}}
if got := wildcard.probeAddr(); got != "127.0.0.1:8080" {
t.Fatalf("probeAddr() wildcard = %q, want 127.0.0.1:8080", got)
}
wildcard6 := &serverListeners{bound: []string{"[::]:8080"}}
if got := wildcard6.probeAddr(); got != "[::1]:8080" {
t.Fatalf("probeAddr() ipv6 wildcard = %q, want [::1]:8080", got)
}
tailnetOnly := &serverListeners{bound: []string{"100.64.0.1:8080"}}
if got := tailnetOnly.probeAddr(); got != "100.64.0.1:8080" {
t.Fatalf("probeAddr() tailnet-only = %q, want 100.64.0.1:8080", got)
}
}