-
Type: Improvement
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 2.0.39
-
Component/s: None
-
Environment:Nodejs 0.10.25
Linux Ubuntu
MongoDB server in localhost
-
Empty show more show less
I share the mongodb connection thought all http requests that my webserver (nodejs) receives.
When i want to stop the webserver, before all, I refuse new connections, close mongodb connection, and the process exits graceful (all sockets are closed and the event loop is empty).
But, if the `MongoClient.close` method is called while a http request writes/reads from datas from mongo, an exception is thrown.
As attachment, there's an example of this problem.
How can I wait for all connection closing?