curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Girard-Reydet (JIRA)" <>
Subject [jira] [Created] (CURATOR-180) Rare occurences of NoNodeException in InterPRocessSemaphoreMurex.acquire
Date Fri, 09 Jan 2015 15:04:35 GMT
Girard-Reydet created CURATOR-180:

             Summary: Rare occurences of NoNodeException in InterPRocessSemaphoreMurex.acquire
                 Key: CURATOR-180
             Project: Apache Curator
          Issue Type: Bug
          Components: Recipes
    Affects Versions: 2.4.1
         Environment: Curator 3.4.1
ZooKeeper 3.4.6 + patch ZOOKEEPER-922
Sun JDK 1.7.0_51-b13
SunOS 5.10 Generic_147441-01 i86pc i386
            Reporter: Girard-Reydet

On some occasions, acquiring a semaphore will raise a NoNode exception (see stack below).
I don't have statistics, but overs 3 weeks with about 20 test jobs/day, I observed it only

If I refer to the code, the parent nodes (here {{/locks/-licence}}) should be created if it
does not exist:

    private InternalAcquireResult internalAcquire1Lease(ImmutableList.Builder<Lease>
builder, long startMs, boolean hasWait, long waitMs) throws Exception
        // ... skipping to the problematic lines
            PathAndBytesable<String> createBuilder = client.create().creatingParentsIfNeeded().withProtection().withMode(CreateMode.EPHEMERAL_SEQUENTIAL);
            String path = (nodeData != null) ? createBuilder.forPath(ZKPaths.makePath(leasesPath,
LEASE_BASE_NAME), nodeData) : createBuilder.forPath(ZKPaths.makePath(leasesPath, LEASE_BASE_NAME));

Here is the observed stack:
org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /locks/-license/leases
	at org.apache.zookeeper.KeeperException.create(
	at org.apache.zookeeper.KeeperException.create(
	at org.apache.zookeeper.ZooKeeper.getChildren(
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl$
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl$
	at org.apache.curator.RetryLoop.callWithRetry(
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl.pathInForeground(
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(
	at org.apache.curator.framework.imps.GetChildrenBuilderImpl.forPath(
	at registry.backend.zk.ZooKeeperNodesManager$ZooKeeperRegistryLock.acquire(
	... 11 more

Note that I can have several processes concurrently trying to grab the lock at the same time.
It is also possible that they concurrently try to grab it while the parent path does not yet

This message was sent by Atlassian JIRA

View raw message