Commit b20f767e authored by Juan Batiz-Benet's avatar Juan Batiz-Benet
Browse files

p2p/net/conn: timeouts are real failures.

parent bdda7ff6
...@@ -147,6 +147,11 @@ func reuseErrShouldRetry(err error) bool { ...@@ -147,6 +147,11 @@ func reuseErrShouldRetry(err error) bool {
return false // hey, it worked! no need to retry. return false // hey, it worked! no need to retry.
} }
// if it's a network timeout error, it's a legitimate failure.
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
return true
}
errno, ok := err.(syscall.Errno) errno, ok := err.(syscall.Errno)
if !ok { // not an errno? who knows what this is. retry. if !ok { // not an errno? who knows what this is. retry.
return true return true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment