From c2661f7c75d877414592fbdd0c7eff4eb210ca9a Mon Sep 17 00:00:00 2001 From: lakshit verma Date: Sat, 8 Aug 2026 00:57:43 +0530 Subject: [PATCH] bridge: make the cache-sync channel buffered to avoid a goroutine leak On timeout the manager goroutine still finishes WaitForCacheSync and closes the synced channel, but nobody reads it: on an unbuffered channel that close blocks forever. A buffer of one lets the goroutine finish. --- pkg/bridge/lookup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/bridge/lookup.go b/pkg/bridge/lookup.go index 204af79..5727eb5 100644 --- a/pkg/bridge/lookup.go +++ b/pkg/bridge/lookup.go @@ -58,7 +58,7 @@ func NewManagerForClientWithTimeout(client kubernetes.Interface, timeout time.Du m := runtimeclass.NewManager(client) stop := make(chan struct{}) m.Start(stop) - synced := make(chan struct{}) + synced := make(chan struct{}, 1) go func() { m.WaitForCacheSync(stop) close(synced)