Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3007

Kahadb LockFile.lock() leaks file descriptors if tryLock() returns an IOException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.3.2, 5.4.0, 5.4.1
    • 5.4.2
    • Message Store
    • None
    • Ubuntu Linux, activemq 5.3.2, master slave configuration with kahadb configured directory on a smb mount.

    Description

      The slave will output these messages:

      INFO | Database /mnt/activemqdata/lock is locked... waiting 10 seconds for the database to be unlocked ......

      After awhile, the messages change to:

      INFO | Database /mnt/activemqdata/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.FileNotFoundException: /mnt/activemq/lock (Too many open files) ....

      Upon inspection of LockFile.lock(), OverlappingFileLockException is the only exception caught. In the event tryLock() throws IOException, as it does in
      my case, the readFile isn't cleaned up and the caller (which catches IOExceptions), just iterates again.

      Since javadoc says FileChannel.tryLock() throws an IOException, and the caller in this case, and MessageDatabase expects to catch IOExceptions, it
      would seem like adding this to the code in LockFile.lock() should fix this issue.

      catch (IOException e)
      {
      reason = e;
      }

      Attachments

        Activity

          People

            gtully Gary Tully
            marcuss Marcus Smith
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: