From 0b005c3e76933abe49d409da61ba9437527eda15 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 21 Apr 2026 19:37:58 +0000 Subject: [PATCH] Add debug logs around exiting goroutines I'm debugging our clean shutdown --- platform/arcgis.go | 3 ++- platform/start.go | 3 +++ ts/SSEManager.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/arcgis.go b/platform/arcgis.go index f8521877..478148d8 100644 --- a/platform/arcgis.go +++ b/platform/arcgis.go @@ -136,9 +136,10 @@ func refreshFieldseekerData(background_ctx context.Context, newOauthCh <-chan st select { case <-ctx.Done(): - log.Info().Msg("Exiting refresh worker...") + log.Debug().Msg("Exiting arcgis refresh worker...") cancel() wg.Wait() + log.Debug().Msg("arcgis refresh worker exited.") return case <-newOauthCh: log.Info().Msg("Updating oauth background work") diff --git a/platform/start.go b/platform/start.go index 77f314cf..a008e687 100644 --- a/platform/start.go +++ b/platform/start.go @@ -58,11 +58,13 @@ func StartAll(ctx context.Context) error { go func() { defer waitGroup.Done() refreshFieldseekerData(ctx, newOAuthTokenChannel) + log.Debug().Msg("Exiting Fieldseeker refresh goroutine") }() waitGroup.Add(1) go func() { defer waitGroup.Done() listenForJobs(ctx) + log.Debug().Msg("Exiting job listener goroutine") }() err = addWaitingJobs(ctx) @@ -136,6 +138,7 @@ func listenForJobs(ctx context.Context) { select { case <-ctx.Done(): + log.Debug().Msg("Exiting listenForJobs") return default: // If listenAndSendOneConn returned and ctx has not been cancelled that means there was a fatal database error. diff --git a/ts/SSEManager.ts b/ts/SSEManager.ts index 6011496c..62945b04 100644 --- a/ts/SSEManager.ts +++ b/ts/SSEManager.ts @@ -61,6 +61,7 @@ export const SSEManager: SSEManagerType = (function (): SSEManagerType { // Reconnect after delay setTimeout(() => { + console.log("SSE reconnecting"); connectionPromise = null; connect(url); }, 5000); @@ -80,6 +81,7 @@ export const SSEManager: SSEManagerType = (function (): SSEManagerType { eventSource = null; isConnected = false; connectionPromise = null; + console.log("SSE disconnected"); } }