Skip to content

Commit

Permalink
Merge pull request #8 from CDLUC3/lockLogic
Browse files Browse the repository at this point in the history
Evidence of duplicate acquires.  Try to eliminate
  • Loading branch information
mreyescdl authored Feb 5, 2025
2 parents ba0ed10 + 8307d5d commit 2142a28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/cdlib/mrt/zk/QueueItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ public void setStatusTrigger(ZooKeeper client) throws MerrittZKNodeInvalid, Keep
public boolean lock(ZooKeeper client) throws InterruptedException {
String statpath = makePath(ZKKey.LOCK);
try {
QueueItemHelper.createEphemeral(client, statpath, QueueItemHelper.empty);
return true;
if (! QueueItemHelper.createEphemeral(client, statpath, QueueItemHelper.empty).isEmpty())
return true;
else
return false;
} catch(KeeperException e) {
return false;
}
Expand Down

0 comments on commit 2142a28

Please sign in to comment.