[ 
https://issues.apache.org/jira/browse/CURATOR-607?focusedWorklogId=659359&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-659359
 ]

ASF GitHub Bot logged work on CURATOR-607:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Oct/21 19:29
            Start Date: 03/Oct/21 19:29
    Worklog Time Spent: 10m 
      Work Description: faucct commented on pull request #394:
URL: https://github.com/apache/curator/pull/394#issuecomment-933011518


   Also, I think that there would be no need to expose lock-paths and use 
transactions if Curator exposed APIs with no implicit retries, where everything 
would happen in same session:
   
   ```
   var lock = new Lock(path);
   while (true) {
     try {
       var zookeeper = curatorFramework.getZookeeperClient().getZooKeeper();
       lock.lock(zookeeper);
       try {
         zookeeper.create("");
         zookeeper.delete("");
         ...
       } finally {
         lock.unlock(zookeeper);
       }
     } catch (Exception e) {
       if (curatorFramework.retry(e)) {
         continue;
       }
       throw e;
     }
   }
   ```
   
   or even
   
   ```
   var lock = new Lock(path);
   curatorFramework.zookeeper(zookeeper -> {
     lock.lock(zookeeper);
     try {
       zookeeper.create("");
       zookeeper.delete("");
       ...
     } finally {
       lock.unlock(zookeeper);
     }
   });
   ```
   
   Would you mind me pull-requesting such APIs?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 659359)
    Time Spent: 1.5h  (was: 1h 20m)

> Method getLockPath of InterProcessReadWriteLock locks is not exposed for use 
> in transactions
> --------------------------------------------------------------------------------------------
>
>                 Key: CURATOR-607
>                 URL: https://issues.apache.org/jira/browse/CURATOR-607
>             Project: Apache Curator
>          Issue Type: Bug
>            Reporter: Никита Соколов
>            Assignee: Jordan Zimmerman
>            Priority: Major
>             Fix For: 5.2.1
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to