-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
What problem are you facing?
https://github.com/mongodb/node-mongodb-native/pull/3596 added a welcome fix to stop topologies leaking (which we've previously been working around).
However, it doesn't address another issue we've seen with this sort of lock, which is that if the topology is closed during connection, a reconnection attempt never resolves.
This is probably easiest to describe with a (currently failing) test case:
it('releases the lock if the topology is closed before connection is complete', function (done) { client.connect(); client.close(); client.once('topologyClosed', async () => { await client.connect(); expect(client.topology?.isConnected()).to.be.true; done(); }); });
The above test case will currently timeout (ie the reconnection is never resolved).
What driver and relevant dependency versions are you using?
This is the bleeding-edge version on main (not yet released).
Steps to reproduce?
See above test case.