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:
parent
22b5b78530
commit
85d90d9dd9
@ -107,7 +107,11 @@ func (cp *clusterProxy) monitor(wa endpoints.WatchChannel) {
|
|||||||
case <-cp.ctx.Done():
|
case <-cp.ctx.Done():
|
||||||
cp.lg.Info("watching endpoints interrupted", zap.Error(cp.ctx.Err()))
|
cp.lg.Info("watching endpoints interrupted", zap.Error(cp.ctx.Err()))
|
||||||
return
|
return
|
||||||
case updates := <-wa:
|
case updates, ok := <-wa:
|
||||||
|
if !ok {
|
||||||
|
cp.lg.Info("endpoints watch channel closed")
|
||||||
|
return
|
||||||
|
}
|
||||||
cp.umu.Lock()
|
cp.umu.Lock()
|
||||||
for _, up := range updates {
|
for _, up := range updates {
|
||||||
switch up.Op {
|
switch up.Op {
|
||||||
|
Loading…
Reference in New Issue
Block a user