Skip to content

Commit 64e1692

Browse files
committed
fix: dont log endless use of closed network connection
1 parent f58104a commit 64e1692

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

proxy/websocket_pump.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"encoding/json"
77
"errors"
88
"math/rand/v2"
9+
"strings"
910
"sync/atomic"
1011
"time"
1112

@@ -146,10 +147,19 @@ func (p *websocketPump) pumpMessages(
146147
doneWrites := make(chan struct{}, 1)
147148

148149
notifyOnFailure := func(err error) {
150+
if err == nil {
151+
return
152+
}
153+
149154
select {
150155
case failure <- err:
151-
// no-op
156+
return
157+
152158
default:
159+
if strings.Contains(err.Error(), "use of closed network connection") {
160+
return
161+
}
162+
153163
l.Warn("Dropping websocket pump failure b/c the channel is full",
154164
zap.Error(err),
155165
)

0 commit comments

Comments
 (0)