Merge pull request #277 from QiWang19/retry-eof

Enable retry EOF from http request
This commit is contained in:
OpenShift Merge Robot 2020-08-23 06:49:15 -04:00 committed by GitHub
commit e5ea066b38
1 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package retry
import (
"context"
"io"
"math"
"net"
"net/url"
@ -58,7 +59,10 @@ func isRetryable(err error) bool {
return true
case *net.OpError:
return isRetryable(e.Err)
case *url.Error:
case *url.Error: // This includes errors returned by the net/http client.
if e.Err == io.EOF { // Happens when a server accepts a HTTP connection and sends EOF
return true
}
return isRetryable(e.Err)
case syscall.Errno:
return e != syscall.ECONNREFUSED