From 5c33b75b59bc40ff7f2ab11223dc6d0366904d55 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Fri, 23 Jan 2015 05:24:23 -0800 Subject: [PATCH] p2p/net/conn: timeouts are real failures. --- p2p/net/conn/dial.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/p2p/net/conn/dial.go b/p2p/net/conn/dial.go index 33f6e07b2..adf087110 100644 --- a/p2p/net/conn/dial.go +++ b/p2p/net/conn/dial.go @@ -147,6 +147,11 @@ func reuseErrShouldRetry(err error) bool { 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) if !ok { // not an errno? who knows what this is. retry. return true