Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2074

Mongo client is leaking unclosed connection thread.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.2.2, 2.14.2
    • Affects Version/s: 2.12.0
    • Component/s: Cluster Management
    • Labels:
      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.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            bin.lan Bin Lan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: