mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-21 10:30:24 +00:00
revert back to IsUnexpectedCloseError check
Kubernetes-commit: 914210ee9a6df6927019f200e90534edd1460fea
This commit is contained in:
parent
e95d92dbc6
commit
9a88950e38
@ -18,10 +18,8 @@ package remotecommand
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -478,15 +476,12 @@ func (h *heartbeat) start() {
|
|||||||
klog.V(8).Infof("Websocket Ping succeeeded")
|
klog.V(8).Infof("Websocket Ping succeeeded")
|
||||||
} else {
|
} else {
|
||||||
klog.Errorf("Websocket Ping failed: %v", err)
|
klog.Errorf("Websocket Ping failed: %v", err)
|
||||||
if errors.Is(err, gwebsocket.ErrCloseSent) {
|
if gwebsocket.IsUnexpectedCloseError(err, gwebsocket.CloseGoingAway, gwebsocket.CloseAbnormalClosure) {
|
||||||
continue
|
return
|
||||||
} else if e, ok := err.(net.Error); ok && e.Temporary() {
|
}
|
||||||
// Continue, in case this is a transient failure.
|
// Continue, in case this is a transient failure.
|
||||||
// c.conn.CloseChan above will tell us when the connection is
|
// c.conn.CloseChan above will tell us when the connection is
|
||||||
// actually closed.
|
// actually closed.
|
||||||
continue
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user