You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@curator.apache.org by Zili Chen <wa...@gmail.com> on 2019/09/11 23:57:21 UTC

Concurrent createContainers

Hi Curators,

If there are concurrent createContainers or
creatingParentContainersIfNeeded, is it a race condition that one of
them fails with KeeperException.NodeExistException?

Said thread-1 calls createContainers("/a/b/c/d") while thread-2 calls
createContainers("/a/b/c/e"), I would expect it works as

$ mkdir -p a/b/c/d
$ mkdir -p a/b/c/e

all directory made and no exception thrown.

Best,
tison.

Re: Concurrent createContainers

Posted by Jordan Zimmerman <jo...@jordanzimmerman.com>.
Yeah - that would be something else as you correctly note ZKPaths catches KeeperException.NodeExistsException internally.

> On Sep 11, 2019, at 9:48 PM, Zili Chen <wa...@gmail.com> wrote:
> 
> I notice that methods mentioned above internally call ZKPaths.mkdirs which
> tolerates KeeperException.NodeExistException. So it is not a problem.
> 
> Correct me if I am wrong.
> 
> Best,
> tison.
> 
> 
> Zili Chen <wander4096@gmail.com <ma...@gmail.com>> 于2019年9月12日周四 上午7:57写道:
> Hi Curators,
> 
> If there are concurrent createContainers or creatingParentContainersIfNeeded, is it a race condition that one of
> them fails with KeeperException.NodeExistException?
> 
> Said thread-1 calls createContainers("/a/b/c/d") while thread-2 calls
> createContainers("/a/b/c/e"), I would expect it works as
> 
> $ mkdir -p a/b/c/d
> $ mkdir -p a/b/c/e
> 
> all directory made and no exception thrown.
> 
> Best,
> tison.


Re: Concurrent createContainers

Posted by Zili Chen <wa...@gmail.com>.
I notice that methods mentioned above internally call ZKPaths.mkdirs which
tolerates KeeperException.NodeExistException. So it is not a problem.

Correct me if I am wrong.

Best,
tison.


Zili Chen <wa...@gmail.com> 于2019年9月12日周四 上午7:57写道:

> Hi Curators,
>
> If there are concurrent createContainers or
> creatingParentContainersIfNeeded, is it a race condition that one of
> them fails with KeeperException.NodeExistException?
>
> Said thread-1 calls createContainers("/a/b/c/d") while thread-2 calls
> createContainers("/a/b/c/e"), I would expect it works as
>
> $ mkdir -p a/b/c/d
> $ mkdir -p a/b/c/e
>
> all directory made and no exception thrown.
>
> Best,
> tison.
>