curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsinth <...@git.apache.org>
Subject [GitHub] curator pull request: CURATOR-33 recursive TreeCache recipe
Date Fri, 01 Aug 2014 18:18:10 GMT
Github user dragonsinth commented on the pull request:

    https://github.com/apache/curator/pull/17#issuecomment-50917378
  
    Okay, the outstandingOps race was easy to resolve, I'm changing refresh() to do this:
    
    ```
    private void refresh() throws Exception
    {
        // Push an extra op so that a race between refreshData() response and
        // refreshChildren() can't cause the outstanding ops to drop to zero.
        try {
            outstandingOps.incrementAndGet();
            refreshData();
            refreshChildren();
        } finally {
            outstandingOps.decrementAndGet();
        }
    }
    ```
    
    With this I can add a Thread.sleep() at that start of refreshChildren() and there's no
problem.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message