Skip to content

Commit 35c4b30

Browse files
author
Divjot Arora
committed
GODRIVER-1489 Ensure server check is cancelled for network errors during handshake (#471)
1 parent 612412d commit 35c4b30

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mongo/integration/json_helpers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func createClientOptions(t testing.TB, opts bson.Raw) *options.ClientOptions {
9898
clientOpts.SetConnectTimeout(ct)
9999
case "serverSelectionTimeoutMS":
100100
sst := convertValueToMilliseconds(t, opt)
101-
clientOpts.SetConnectTimeout(sst)
101+
clientOpts.SetServerSelectionTimeout(sst)
102102
default:
103103
t.Fatalf("unrecognized client option: %v", name)
104104
}

x/mongo/driver/topology/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ func (s *Server) ProcessHandshakeError(err error, startingGenerationNumber uint6
276276
// checking logic above has already determined that this description is not stale.
277277
s.updateDescription(description.NewServerFromError(s.address, wrappedConnErr, nil))
278278
s.pool.clear()
279+
s.cancelCheck()
279280
}
280281

281282
// Description returns a description of the server as of the last heartbeat.

0 commit comments

Comments
 (0)