-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.3.3
-
Component/s: None
The below script's behavior changed significantly between v3.3.2 and v3.3.3
'use strict'; const mongodb = require('mongodb'); run().catch(error => console.log('Caught', error)); async function run() { const uri = 'mongodb://bad.notadomain:27017/test'; const client = await mongodb.MongoClient.connect(uri, { useNewUrlParser: true, useUnifiedTopology: true }); console.log('Connected'); await client.db().collection('test').findOne({}); console.log('done'); }
Without `useUnifiedTopology`, it fails fast with the below error message:
failed to connect to server [bad.notadomain:27017] on first connect
With `useUnifiedTopology` as of v3.3.3, the script hangs for 30 seconds and finally errors out with `Server selection timed out after 30000 ms`. Is this intentional?