mirror of
https://github.com/vee1e/runtimeclass-debugger.git
synced 2026-09-01 10:18:42 +00:00
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.
This commit is contained in:
parent
2d74853196
commit
c2661f7c75
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue