summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVesselina Ratcheva <vesselina.ratcheva@10gen.com>2019-05-22 18:44:51 -0400
committerVesselina Ratcheva <vesselina.ratcheva@10gen.com>2019-05-24 13:08:42 -0400
commitefe7bc8007aa932a1533af95d980909cd4a39670 (patch)
tree036d80ca6c1d1864c09c60bb457c8652fc31ba58
parent202ba6150bcc276f2734479ef853dc38cf8d4d3f (diff)
downloadmongo-efe7bc8007aa932a1533af95d980909cd4a39670.tar.gz
SERVER-39770 Add retry logic to FSM connection cache setup
-rw-r--r--jstests/concurrency/fsm_libs/fsm.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/jstests/concurrency/fsm_libs/fsm.js b/jstests/concurrency/fsm_libs/fsm.js
index ab86c3098a6..3aa73477425 100644
--- a/jstests/concurrency/fsm_libs/fsm.js
+++ b/jstests/concurrency/fsm_libs/fsm.js
@@ -31,7 +31,11 @@ var fsm = (function() {
// same session, we override the "_defaultSession" property of the connections in the
// cache to be the same as the session underlying 'args.db'.
const makeNewConnWithExistingSession = function(connStr) {
- const conn = new Mongo(connStr);
+ // We may fail to connect if the continuous stepdown thread had just terminated
+ // or killed a primary. We therefore use the connect() function defined in
+ // network_error_and_transaction_override.js to add automatic retries to
+ // connections. The override is loaded in worker_thread.js.
+ const conn = connect(connStr).getMongo();
conn._defaultSession = new _DelegatingDriverSession(conn, args.db.getSession());
return conn;
};