-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
If authentication fails monglo cleaner thread will stuck in waiting state forever. So if you try continuously to connect to the database it causes the memory leak. I tried to look at javadoc and there is no information that it is necessary to call close() if authentication fails. And tutorial for beginner is withou calling method close() if authentication fails http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-java-driver/#getting-started-with-java-driver
Here is my stackt trace
com.mongodb.MongoException$Network: IOException authenticating the connection
at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:552)
at com.mongodb.DBPort.authenticate(DBPort.java:322)
at com.mongodb.DBTCPConnector.authenticate(DBTCPConnector.java:621)
at com.mongodb.DBApiLayer.doAuthenticate(DBApiLayer.java:180)
at com.mongodb.DB.authenticateCommandHelper(DB.java:630)
at com.mongodb.DB.authenticate(DB.java:588)
I think that it should be fixed in connector in method authenticate so I send pull request for it.
If it is fixed in wrong place or in wrong way, please correct it. If it should not be fixed please update mongo java driver tutorial and javadoc to prevent that another beginner create memory leak in his application.
Thanks a lot