Skip to content

Commit db4d030

Browse files
rsafonsecak8s-infra-cherrypick-robot
authored andcommitted
fix: grpcproxy can get stuck in and endless loop causing high cpu usage
Signed-off-by: Rafael da Fonseca <[email protected]>
1 parent 79dfce8 commit db4d030

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/proxy/grpcproxy/cluster.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ func (cp *clusterProxy) monitor(wa endpoints.WatchChannel) {
107107
case <-cp.ctx.Done():
108108
cp.lg.Info("watching endpoints interrupted", zap.Error(cp.ctx.Err()))
109109
return
110-
case updates := <-wa:
110+
case updates, ok := <-wa:
111+
if !ok {
112+
cp.lg.Info("endpoints watch channel closed")
113+
return
114+
}
111115
cp.umu.Lock()
112116
for _, up := range updates {
113117
switch up.Op {

0 commit comments

Comments
 (0)