Skip to content

Commit 6b0e5c6

Browse files
markusthoemmesknative-prow-robot
authored andcommitted
[CP] Turn websocket's handshake timeout down again. (#6243)
1 parent 96cffff commit 6b0e5c6

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Gopkg.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/knative.dev/pkg/websocket/connection.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ func NewDurableSendingConnection(target string, logger *zap.SugaredLogger) *Mana
106106
// go func() {for range messageChan {}}
107107
func NewDurableConnection(target string, messageChan chan []byte, logger *zap.SugaredLogger) *ManagedConnection {
108108
websocketConnectionFactory := func() (rawConnection, error) {
109-
dialer := websocket.DefaultDialer
109+
dialer := &websocket.Dialer{
110+
// This needs to be relatively short to avoid the connection getting blackholed for a long time
111+
// by restarting the serving side of the connection behind a Kubernetes Service.
112+
HandshakeTimeout: 3 * time.Second,
113+
}
110114
conn, _, err := dialer.Dial(target, nil)
111115
if err != nil {
112116
logger.Errorw("Websocket connection could not be established", zap.Error(err))

0 commit comments

Comments
 (0)