Skip to content

Commit

Permalink
Really try to catch connection reset by peer
Browse files Browse the repository at this point in the history
  • Loading branch information
Bowbaq committed Feb 13, 2020
1 parent 945b826 commit cb012ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"io/ioutil"
"net"
"strings"
"time"

retry "github.com/avast/retry-go"
Expand Down Expand Up @@ -278,6 +279,9 @@ func googleRetry(f func() error) error {
if _, ok := err.(*net.OpError); ok {
return true
}
if strings.Contains(err.Error(), "connection reset by peer") {
return true
}
if err == io.EOF {
return true
}
Expand Down

0 comments on commit cb012ab

Please sign in to comment.