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

The com.mongodb.Mongo.close() method can return before the cleanup thread is finished

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.5.2
    • Fix Version/s: 2.6
    • Component/s: None
    • Labels:
      None
    • # Replies:
      2
    • Last comment by Customer:
      true

      Description

      The method com.mongodb.Mongo.close() sets a signal that eventually tells the internal DBCleaner thread to close; which it correctly does. However, since the DBCleaner thread often sleeps, and cleaning up cursors could take a while, the thread will frequently not finish execution until after the close method returns. When this happens in apache tomcat, the following error is seen in tomcat's log files:

      SEVERE: The web application [/someWebApp] appears to have started a thread named [MongoCleaner892931837] but has failed to stop it. This is very likely to create a memory leak.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                6 years, 14 weeks, 6 days ago
                Date of 1st Reply: