Skip to content

Commit

Permalink
Don't backoff if a listener error was a timeout (hashicorp#11594)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgmiller authored May 13, 2021
1 parent 0ef6145 commit a71eebe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vault/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a71eebe

Please sign in to comment.