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

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 3.6
    • None
    • None

      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

            rhn-engineering-bban Bela Ban
            rhn-engineering-bban Bela Ban
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: