Hi Enrico and Chris,

Thanks for your great answer! That helps me a lot!

Regards,
Yong

On Mon, 5 Sept 2022 at 16:24, Chris T. <[email protected]> wrote:

> Hi Yong,
>
> When you run an operation on a node you will mostly get
> ConnectionLossException, which you can retry. When the client connects to
> ZK again after session expiration time is exceeded and it gets a session
> expired notice, your node operation will also get a
> SessionExpiredException. The client will then need to setup a new zookeeper
> object + connection. If you're using an existing framework like Curator
> this will be done for you.
>
> If you're not using an existing framework and d.i.y. the session management
> and you are going to use ephemeral nodes or node watchers then you need to
> pay special attention to session expiration. If if so, let me know and I
> can explain more.
>
> Regards,
>
> Chris
>
>
>
>
>
>
> On Mon, Sep 5, 2022 at 9:29 AM Yong Zhang <[email protected]>
> wrote:
>
> > Hi guys,
> >
> > I saw client has three exceptions: AUTH_FAILED, SESSION_EXPIRED,
> > and CONNECTION_LOSS. The question is about connection loss.
> > Connection loss has various reason to cause. One scenario we saw is the
> > client received the connection loss but the data updated successfully on
> > the
> > server, then we have a mismatch between the memory and zk server.  So
> > our plan is to catch this error and retry it until an explicit error
> throws
> > out. I
> > want to know, if there has other exceptions we need to take care?
> >
> > And I read the code and find there isn’t a timeout exception and looks
> like
> > most exceptions transform to the connection loss exception. Do I
> understand
> > right?
> >
> > Look forward to any answer!
> >
> > Thank you
> > Yong
> >
>

Reply via email to