Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003464 [Resin] minor always 04-28-09 09:15 08-20-09 21:05
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0003464: distributed locking
Description (rep by Martin Thompson)


The semantics I'm looking for would be similar to the following code.

    public void onLoad()
        throws InterruptedException
    {
        final java.util.concurrent.locks.Lock distributedMasterLock = resinServer.getOrCreateLock("ev-master");

        if (distributedMasterLock.tryLock())
        {
            try
            {
                promoteToMaster(); // blocking
            }
            finally
            {
                distributedMasterLock.unlock();
            }
        }
        else
        {
            startSecondaryBackgroundProcesses(); // non-blocking
            distributedMasterLock.lockInterruptibly();
            try
            {
                promoteToMaster();
            }
            finally
            {
                distributedMasterLock.unlock();
            }
        }
    }

Ideally the locking implementation fits the standard Lock interface and offers semantics like the above. For the secondary waiting on the lock it would be necessary that it aquires the lock almost instantly after the master has released it because of calling unlock or if it dies and just goes away without calling unlock.

Additional Information
Attached Files

- Relationships

- Notes
(0004132)
ferg
08-20-09 21:05

server/69--
 

- Issue History
Date Modified Username Field Change
04-28-09 09:15 ferg New Issue
08-20-09 21:05 ferg Note Added: 0004132
08-20-09 21:05 ferg Assigned To  => ferg
08-20-09 21:05 ferg Status new => closed
08-20-09 21:05 ferg Resolution open => fixed
08-20-09 21:05 ferg Fixed in Version  => 4.0.2


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker