-
Notifications
You must be signed in to change notification settings - Fork 349
Description
Kuma Version
master
Describe the bug
When I went through the kds codes, I found that there would be a case to lead goroutine leak.
For example,
on ZoneCP we start startGlobalToZoneSync in a goroutine
https://github.com/kumahq/kuma/blob/2.12.0/pkg/kds/mux/client.go#L115,
later, we'll call OnGlobalToZoneSyncStarted
callback function and it's running in a goroutine.
https://github.com/kumahq/kuma/blob/2.12.0/pkg/kds/mux/client.go#L138
Also, the handleProcessingErrors
would be stuck waiting for the processingErrorsCh
channel
https://github.com/kumahq/kuma/blob/2.12.0/pkg/kds/mux/client.go#L257-L263
And, if you go back to check the OnGlobalToZoneSyncStarted
callback function
https://github.com/kumahq/kuma/blob/2.12.0/pkg/kds/zone/components.go#L74-L85
There might be a case that once if we hit the error context.Canceled
, we won't send error to the errChan
channel. In such a situation, the above handleProcessingErrors
function would be stuck indefinitely
To Reproduce
No response
Expected behavior
no goroutine leak
Additional context (optional)
No response