Remove call to deprecated neterr.Temporary() method

This commit is contained in:
Zac Bergquist
2022-04-14 09:25:41 -06:00
committed by Zac Bergquist
parent 5e93905792
commit 231381f83f
+6 -7
View File
@@ -18,7 +18,6 @@ import (
"io"
"net"
"os"
"strings"
"time"
"github.com/gravitational/teleport/lib/utils"
@@ -98,11 +97,11 @@ func (a *AgentServer) Serve() error {
if !ok {
return trace.Wrap(err, "unknown error")
}
if !neterr.Temporary() {
if strings.Contains(neterr.Error(), "use of closed network connection") {
return nil
}
log.WithError(err).Error("Got permanent error.")
if utils.IsUseOfClosedNetworkError(neterr) {
return nil
}
if !neterr.Timeout() {
log.WithError(err).Error("Got non-timeout error.")
return trace.Wrap(err)
}
if tempDelay == 0 {
@@ -113,7 +112,7 @@ func (a *AgentServer) Serve() error {
if max := 1 * time.Second; tempDelay > max {
tempDelay = max
}
log.WithError(err).Errorf("Got temporary error (will sleep %v).", tempDelay)
log.WithError(err).Errorf("Got timeout error (will sleep %v).", tempDelay)
time.Sleep(tempDelay)
continue
}