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 [email protected] or file a JIRA ticket
with INFRA.
---