-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.12.0
-
Component/s: Cluster Management
-
None
On cloud manager, we have some cron job that creates new MongoClient to all the backing mongodb process to make sure that they are up and without startup warning.
We observe that a lot of these ad-hoc clients are not being closed properly. On our side, we do guard the connection instance with a try/finally to make sure the close() method is called.
An example thread dump line looks like this:
"cluster-374495-hostname:port" #817624 daemon prio=5 os_prio=0 tid=0x00007ff9c8276000 nid=0x33b8 waiting on condition [0x00007ff90594e000]
Note that the counter #817624 is relatively large and we do find multiple instance to the same host on the same thread dump. This points to a potential MongoClient leak.
And the clients seem to be all from arbiter processes since they have all the higher counter number thread.