Hi Jordan, thanks for your reply!

Yes, the same client creates and deletes '/test1' and PathChildrenCache is
started before creating '/test1'. I think the scenario you envisioned is
exactly what I'm facing. It makes me easier to understand what may be
happening in ZooKeeper.

We're planning to move to an HTTP-based coordination instead of using
ZooKeeper, and maybe we need to move early to avoid this kind of issues.

Best,
Jihoon

2017년 11월 12일 (일) 오전 2:36, Jordan Zimmerman <[email protected]>님이
작성:

> ZooKeeper does not guarantee that you will get every event. There are
> myriad ways that a client can miss events. If you are writing an
> application that depends on getting every event then ZooKeeper is not a
> good solution for you.
>
> In your example, are the create of "/test1" and the delete of "/test1"
> done by the same client? Is the PathChildrenCache started when the create
> of "/test1" is done? I can envision this scenario:
>
> * At T1 PathChildrenCache is started
> * At T2 your test code creates "/test1"
> * At T3 PathChildrenCache's watcher gets the called
> * At T4 your test code deletes "/test1"
> * At T5 PathChildrenCache tries to read "/test1" and it's no longer there
> so it ignores it - no events are reported
>
> -Jordan
>
> > On Nov 10, 2017, at 11:57 PM, Jihoon Son <[email protected]> wrote:
> >
> > Hi,
> >
> > I'm using Curator 4.0.0 and Curator-testing 2.12.0 for the Zookeeper
> compatibility.
> >
> > Recently, one of our unit tests keeps failing, and I found an weird case
> while looking into it. The unit test essentially does followings.
> >
> > - Makes a PathChildrenCache for '/' and writes something on a '/test1'
> in background. The PathChildrenCache has an event listener for the
> 'CHILD_REMOVED' event.
> > - Deletes '/test1' transactionally.
> > - Expects PathChildrenCache does something on 'CHILD_REMOVED' event.
> >
> > This test works well in local, but mostly fails on travis. The problems
> is, if the delete in the second step is performed before the actual write
> on '/test1' is done in the first step, PathChildrenCache never receives the
> 'CHILD_REMOVED' event.
> >
> > I'm not sure this is a bug or not. Is there any way to guarantee for
> PathChildrenCache to receive 'CHILD_REMOVED' event properly?
> >
> > Thanks,
> > Jihoon
>
>

Reply via email to