提交 5c33b75b 作者: Juan Batiz-Benet

p2p/net/conn: timeouts are real failures.

上级 4a5f5e2e
......@@ -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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论