mirror of
https://github.com/gravitational/teleport.git
synced 2026-09-21 14:35:22 +08:00
Remove call to deprecated neterr.Temporary() method
This commit is contained in:
committed by
Zac Bergquist
parent
5e93905792
commit
231381f83f
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user