Skip to content

Conversation

@natesilva
Copy link

Currently MongoClient.connect prevents Node from exiting if an authorization failure occurs.

It assumes that if Db.connect returned an error, that the database wasn’t open. But in fact, Db.connect can return both and error and a db object.

So, in case of an error, check for a db object, and if it exists, close the connection.

@natesilva natesilva closed this Feb 21, 2013
@natesilva
Copy link
Author

Closed this because, on further examination, it’s a bug in Db.connect. Will be sending a pull request for that shortly.

@natesilva natesilva deleted the fix-mongoclient-connect-hang branch February 21, 2013 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant