Don't backoff if a listener error was a timeout (#11594)

This commit is contained in:
Scott Miller 2021-05-13 17:02:25 -05:00 committed by GitHub
parent 491f71faf0
commit 7b05fcf9bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -301,12 +301,17 @@ func (cl *Listener) Run(ctx context.Context) error {
// Accept the connection
conn, err := tlsLn.Accept()
if err != nil {
if err, ok := err.(net.Error); ok && !err.Timeout() {
err, ok := err.(net.Error)
if ok && !err.Timeout() {
cl.logger.Debug("non-timeout error accepting on cluster port", "error", err)
}
if conn != nil {
conn.Close()
}
if ok && err.Timeout() {
loopDelay = 0
continue
}
if loopDelay == 0 {
loopDelay = baseDelay