From ddcda9f7a280d567ecae39c3f9a66a4116064017 Mon Sep 17 00:00:00 2001 From: Roberto D'Auria Date: Thu, 23 Jul 2026 13:47:59 +0200 Subject: [PATCH] fix(register): exit when the /ready healthcheck server fails --- cmd/register/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/register/main.go b/cmd/register/main.go index 859a5df..3395656 100644 --- a/cmd/register/main.go +++ b/cmd/register/main.go @@ -100,10 +100,14 @@ func main() { siteProb.Value = fmt.Sprintf("%f", probability) - // Set up health server. + // Set up health server. If it dies, exit so the supervisor restarts us: + // a silently dead /ready endpoint makes readiness checks fail forever + // while the process still looks healthy. mux := http.NewServeMux() mux.HandleFunc("/ready", Ready) - go http.ListenAndServe(*hcAddr, mux) + go func() { + rtx.Must(http.ListenAndServe(*hcAddr, mux), "Failed to serve /ready endpoint") + }() // Register for the first time. register()