-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Empty show more show less
If I call db.close on a connection, this.s.topology.close is called synchronously. I can't find where the logic for topology.close exists, but I would think that it would be closed async. I am encountering issues across a large test suite (which sometimes opens/closes quickly) that causes "destroyed topology" errors to be thrown. If I introduce a delay before closing connections then the error disappears. This makes me believe that the db is not actually closed.
db.close appears to be a wrapper around topology.close that emits close events, but fails to call topology.close async.
See: https://github.com/mongodb/node-mongodb-native/blob/2.1/lib/db.js#L368