fix: grpcproxy can get stuck in and endless loop causing high cpu usage

Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com>
This commit is contained in:
Rafael da Fonseca 2025-03-07 11:11:59 +00:00
parent 22b5b78530
commit 85d90d9dd9

View File

@ -107,7 +107,11 @@ func (cp *clusterProxy) monitor(wa endpoints.WatchChannel) {
case <-cp.ctx.Done():
cp.lg.Info("watching endpoints interrupted", zap.Error(cp.ctx.Err()))
return
case updates := <-wa:
case updates, ok := <-wa:
if !ok {
cp.lg.Info("endpoints watch channel closed")
return
}
cp.umu.Lock()
for _, up := range updates {
switch up.Op {