-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: 3.0.6
-
Component/s: None
-
(copied to CRM)
-
Empty show more show less
When connecting to a cluster using a SRV record, the Node driver hangs indefinitely if the read preference is primary and the first SDAM event returns a topology type of ReplicaSetNoPrimary, even though the cluster has a primary and is in a healthy state.
Steps to reproduce:
const { MongoClient } = require('mongodb'); const client = new MongoClient( "mongodb+srv://<redacted>/admin?readPreference=primary&appname=MongoDB%20Compass%20Dev&authSource=admin&ssl=true", { readPreference: "primary", connectWithNoPrimary: true, checkServerIdentity: true, sslValidate: true } ); client.connect((err, c) => { // This block will never get executed. console.log('in connected block'); console.log(err); console.log(c); });
Switching to primaryPreferred as the read preference will always connect.
- depends on
-
COMPASS-2711 Atlas SRV connection string causes Compass to hang after CONNECT click during connection attempt
- Closed