Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1499

Investigate using pthread_mutexattr_setrobust to eliminate stale locks in LMDB

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.1
    • Component/s: Internal Databases
    • Labels:
      None

      Description

      @pthread_mutexattr_setrobust@ or @pthread_mutexattr_setrobust_np@ is a pthread mutex attribute which makes the mutex immune to stale locks from deceased processes. When a process dies, one of the other threads waiting for the lock will get @EOWNERDEAD@, and are expected to clean up the mess before continuing. Cleaning up might be hard, but at least the processes are allowed to continue with an error, which is better than to hang. If you don't clean up, all subsequent attempts to lock will result in an error. When the last process has closed the DB, LMDB will reinitialize the mutex on the next open, at which point we should be back in business.

      The change will need to be made inside LMDB itself, and is worth discussing with the author, if we decide to do this.

      @pthread_mutexattr_setrobust@ is available on:

      • Linux
      • Windows
      • Solaris

      Not available on:

      • AIX
      • HPUX

        Attachments

          Release management

            Issue Links

              Activity

                People

                Assignee:
                a10040 Kristian Amlie
                Reporter:
                a10040 Kristian Amlie
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: