Skip to content

Commit

Permalink
Merge pull request #36 from storageos/feature/DEV-1867-cli-should-sup…
Browse files Browse the repository at this point in the history
…port-multiple-endpoint

add timeouts for dial requests
  • Loading branch information
JoeReid authored Jan 26, 2018
2 parents e06f2d8 + e8fe902 commit 3a40323
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netutil/multidialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ func (m *MultiDialer) DialContext(ctx context.Context, network, ignoredAddress s
return nil, ctx.Err()

default:
conn, err := m.Dialer.DialContext(ctx, network, addr)
// Create new child context for a single dial
dctx, cancel := context.WithTimeout(ctx, time.Second)
defer cancel()

conn, err := m.Dialer.DialContext(dctx, network, addr)
if err != nil {
continue
}
Expand Down

0 comments on commit 3a40323

Please sign in to comment.