From b326e3f1a62140a0998f6c13ecbcbdfd0400f721 Mon Sep 17 00:00:00 2001 From: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com> Date: Sat, 28 Mar 2026 13:01:28 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20pprof=20port=20conflict=20crashed=20Go?= =?UTF-8?q?=20server=20=E2=80=94=20non-fatal=20bind=20+=20separate=20ports?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server defaults to 6060, ingestor to 6061. Removed shared PPROF_PORT env var. Bind failure logs warning instead of log.Fatal killing the process. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- cmd/ingestor/main.go | 4 +++- cmd/server/main.go | 4 +++- docker-compose.yml | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/ingestor/main.go b/cmd/ingestor/main.go index af08e2db..a16e2b3d 100644 --- a/cmd/ingestor/main.go +++ b/cmd/ingestor/main.go @@ -30,7 +30,9 @@ func main() { } go func() { log.Printf("[pprof] ingestor profiling at http://localhost:%s/debug/pprof/", pprofPort) - log.Fatal(http.ListenAndServe(":"+pprofPort, nil)) + if err := http.ListenAndServe(":"+pprofPort, nil); err != nil { + log.Printf("[pprof] failed to start: %v (non-fatal)", err) + } }() } diff --git a/cmd/server/main.go b/cmd/server/main.go index 7c14a0f4..e8d2d8b4 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -63,7 +63,9 @@ func main() { } go func() { log.Printf("[pprof] profiling UI at http://localhost:%s/debug/pprof/", pprofPort) - log.Fatal(http.ListenAndServe(":"+pprofPort, nil)) + if err := http.ListenAndServe(":"+pprofPort, nil); err != nil { + log.Printf("[pprof] failed to start: %v (non-fatal)", err) + } }() } diff --git a/docker-compose.yml b/docker-compose.yml index 9136d67c..8a474c58 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,7 +67,6 @@ services: environment: - NODE_ENV=staging - ENABLE_PPROF=true - - PPROF_PORT=6060 healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/stats"] interval: 30s