Skip to content

Commit abaa1f0

Browse files
authored
Merge pull request #19561 from k8s-infra-cherrypick-robot/cherry-pick-19554-to-release-3.6
[release-3.6] fix: grpcproxy can get stuck in and endless loop causing high cpu usage
2 parents d7860e1 + db4d030 commit abaa1f0

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)