Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1886

CENTRAL_LOCK: provide option to make a node the lock owner instead of node:thread

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.6
    • Labels:
      None

      Description

      When using distributed locks, we currently use Owner as identity that holds a lock. Owner consists of the node's address and the thread's ID.
      This has the same semantics as ReentrantLock which makes the thread which called Lock.lock() the owner.
      However, in some scenarios, this is too strong and some applications only want the current node to be the lock owner. This is needed in cases where thread T1 locks a lock but thread T2 needs to unlock it.
      This means, however, that all threads in a given node can lock or unlock the same lock.

      Solution

      • Add property use_thread_id_for_lock_owner to CENTRAL_LOCK (default: false)
      • When set, getOwner() sets the thread-id to -1

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                belaban Bela Ban
                Reporter:
                belaban Bela Ban
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: