Stop retrying to connect on permanent failure
@@ -69,3 +69,4 @@ Alexander Inozemtsev <alexander.inozemtsev@gmail.com>
Rob McColl <rob@robmccoll.com>; <rmccoll@ionicsecurity.com>
Viktor Tönköl <viktor.toenkoel@motionlogic.de>
Ian Lozinski <ian.lozinski@gmail.com>
+Michael Highstead <highstead@gmail.com>
@@ -481,6 +481,13 @@ func (pool *hostConnPool) connect() (err error) {
if err == nil {
break
}
+ if opErr, isOpErr := err.(*net.OpError); isOpErr {
+ // if the error is not a temporary error (ex: network unreachable) don't
+ // retry
+ if !opErr.Temporary() {
+ break
+ }
if err != nil {