Skip to content

Commit bd2dddd

Browse files
committed
update tcp dial timout regex to catch broader range of errors and make compatible with windows returns
1 parent 4712040 commit bd2dddd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ func extendedRetryPolicy(resp *http.Response, err error) (bool, error) {
777777

778778
// A regular expression to catch dial timeouts in the underlying TCP session
779779
// connection
780-
tcpDialTimeoutRe := regexp.MustCompile(`dial tcp .*: i/o timeout`)
780+
tcpDialTCPRe := regexp.MustCompile(`dial tcp`)
781781

782782
// A regular expression to match complete packet loss - see comment below on packet-loss scenarios
783783
// completePacketLossRe := regexp.MustCompile(`EOF$`)
@@ -805,7 +805,7 @@ func extendedRetryPolicy(resp *http.Response, err error) (bool, error) {
805805
return false, v
806806
}
807807

808-
if tcpDialTimeoutRe.MatchString(v.Error()) {
808+
if tcpDialTCPRe.MatchString(v.Error()) {
809809
return false, v
810810
}
811811

0 commit comments

Comments
 (0)