You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Ride Shoot Speak <ri...@googlemail.com> on 2011/02/02 12:24:09 UTC

How to handle ZOO_CONNECTING_STATE and ZOO_ASSOCIATING_STATE?

Hi ZooKeepers,

I'd like to get some information about the the states ZOO_CONNECTING_STATE
and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't seem
to find any information about those states. Right now I simply drop the
connection if my callback is called with these states.

TIA
Jan

Re: How to handle ZOO_CONNECTING_STATE and ZOO_ASSOCIATING_STATE?

Posted by Patrick Hunt <ph...@apache.org>.
http://zookeeper.apache.org/doc/trunk/zookeeperProgrammers.html#ch_zkSessions

On Wed, Feb 2, 2011 at 9:36 AM, Patrick Hunt <ph...@apache.org> wrote:
> FYI we're almost done converting the legacy hadoop wiki over to the
> new zk tlp cwiki. Any/all pages should be moved over, if not let us
> know, for example the faq:
> https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ
>
> I do notice that's missing the attachment as well. Unfortunately
> spammers hit the wiki pages hard, as a result infra@a.o had turned off
> attachments. Not sure the status of cwiki.
>
> Ben, what's the status on this? Is there a way we can update this?
> (iirc isn't that diagram also in the docs? perhaps we could re-attach
> from there?)
>
> Patrick
>
> On Wed, Feb 2, 2011 at 4:52 AM, Ride Shoot Speak
> <ri...@googlemail.com> wrote:
>> Oh, I forgot a point. I can't seem to find a definition of CONNECTION_LOSS
>> in the source code. Where does that come from?
>>
>> regards,
>> Jan
>>
>> 2011/2/2 Ride Shoot Speak <ri...@googlemail.com>
>>
>>> Hi Thijs,
>>>
>>> thanks for the information. A state diagram would help me a lot. Can
>>> someone in charge put it online again or just send it to the list please?
>>>
>>> So ZOO_CONNECTING_STATE is when I issue requests to the ZooKeeper server
>>> between zookeeper_init and  ZOO_CONNECTED_STATE. Did I get it right? My
>>> understanding of the ZOO_CONNECTING_STATE state so far was: The client
>>> ZooKeeper library tries to reconnect to the ZooKeeper und tries to
>>> reestablish a pending session. This then results in ZOO_CONNECTED_STATE
>>> or ZOO_EXPIRED_SESSION_STATE. So I guess I was wrong.
>>>
>>> regards,
>>> Jan
>>>
>>> 2011/2/2 Thijs Terlouw <th...@gmail.com>
>>>
>>> On Wed, Feb 2, 2011 at 7:24 PM, Ride Shoot Speak
>>>> <ri...@googlemail.com> wrote:
>>>> > Hi ZooKeepers,
>>>> >
>>>> > I'd like to get some information about the the states
>>>> ZOO_CONNECTING_STATE
>>>> > and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't
>>>> seem
>>>> > to find any information about those states. Right now I simply drop the
>>>> > connection if my callback is called with these states.
>>>> >
>>>> > TIA
>>>> > Jan
>>>>
>>>> Hi Jan,
>>>>
>>>> I would normally refer you to the state diagram of the ZooKeeper
>>>> states, but it seems not to be working (
>>>> http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A1 )
>>>>
>>>> ZOO_CONNECTING_STATE : This is when you try to send a request to the
>>>> ZooKeeper server, when the client library is still actively connecting
>>>> to a server (Session establishment is asynchronous). Requests will be
>>>> queued. If the connection attempt fails, any requests fail with
>>>> CONNECTION_LOSS
>>>>
>>>> ZOO_ASSOCIATING_STATE : I believe the handshake between the client and
>>>> the server is still in progress, also part of the connection process.
>>>>
>>>> I only handle ZOO_EXPIRED_SESSION_STATE (need to explicitly make a new
>>>> zookeeper connection) and ZOO_CONNECTED_STATE (client library is ready
>>>> to be used) explicitly in my client code (I don't use authentication
>>>> so can ignore ZOO_AUTH_FAILED_STATE)
>>>>
>>>> --
>>>> Thijs Terlouw,
>>>> Shenzhen, China
>>>> http://www.startinchina.com
>>>>
>>>
>>>
>>
>

Re: How to handle ZOO_CONNECTING_STATE and ZOO_ASSOCIATING_STATE?

Posted by Patrick Hunt <ph...@apache.org>.
FYI we're almost done converting the legacy hadoop wiki over to the
new zk tlp cwiki. Any/all pages should be moved over, if not let us
know, for example the faq:
https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ

I do notice that's missing the attachment as well. Unfortunately
spammers hit the wiki pages hard, as a result infra@a.o had turned off
attachments. Not sure the status of cwiki.

Ben, what's the status on this? Is there a way we can update this?
(iirc isn't that diagram also in the docs? perhaps we could re-attach
from there?)

Patrick

On Wed, Feb 2, 2011 at 4:52 AM, Ride Shoot Speak
<ri...@googlemail.com> wrote:
> Oh, I forgot a point. I can't seem to find a definition of CONNECTION_LOSS
> in the source code. Where does that come from?
>
> regards,
> Jan
>
> 2011/2/2 Ride Shoot Speak <ri...@googlemail.com>
>
>> Hi Thijs,
>>
>> thanks for the information. A state diagram would help me a lot. Can
>> someone in charge put it online again or just send it to the list please?
>>
>> So ZOO_CONNECTING_STATE is when I issue requests to the ZooKeeper server
>> between zookeeper_init and  ZOO_CONNECTED_STATE. Did I get it right? My
>> understanding of the ZOO_CONNECTING_STATE state so far was: The client
>> ZooKeeper library tries to reconnect to the ZooKeeper und tries to
>> reestablish a pending session. This then results in ZOO_CONNECTED_STATE
>> or ZOO_EXPIRED_SESSION_STATE. So I guess I was wrong.
>>
>> regards,
>> Jan
>>
>> 2011/2/2 Thijs Terlouw <th...@gmail.com>
>>
>> On Wed, Feb 2, 2011 at 7:24 PM, Ride Shoot Speak
>>> <ri...@googlemail.com> wrote:
>>> > Hi ZooKeepers,
>>> >
>>> > I'd like to get some information about the the states
>>> ZOO_CONNECTING_STATE
>>> > and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't
>>> seem
>>> > to find any information about those states. Right now I simply drop the
>>> > connection if my callback is called with these states.
>>> >
>>> > TIA
>>> > Jan
>>>
>>> Hi Jan,
>>>
>>> I would normally refer you to the state diagram of the ZooKeeper
>>> states, but it seems not to be working (
>>> http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A1 )
>>>
>>> ZOO_CONNECTING_STATE : This is when you try to send a request to the
>>> ZooKeeper server, when the client library is still actively connecting
>>> to a server (Session establishment is asynchronous). Requests will be
>>> queued. If the connection attempt fails, any requests fail with
>>> CONNECTION_LOSS
>>>
>>> ZOO_ASSOCIATING_STATE : I believe the handshake between the client and
>>> the server is still in progress, also part of the connection process.
>>>
>>> I only handle ZOO_EXPIRED_SESSION_STATE (need to explicitly make a new
>>> zookeeper connection) and ZOO_CONNECTED_STATE (client library is ready
>>> to be used) explicitly in my client code (I don't use authentication
>>> so can ignore ZOO_AUTH_FAILED_STATE)
>>>
>>> --
>>> Thijs Terlouw,
>>> Shenzhen, China
>>> http://www.startinchina.com
>>>
>>
>>
>

Re: How to handle ZOO_CONNECTING_STATE and ZOO_ASSOCIATING_STATE?

Posted by Ride Shoot Speak <ri...@googlemail.com>.
Oh, I forgot a point. I can't seem to find a definition of CONNECTION_LOSS
in the source code. Where does that come from?

regards,
Jan

2011/2/2 Ride Shoot Speak <ri...@googlemail.com>

> Hi Thijs,
>
> thanks for the information. A state diagram would help me a lot. Can
> someone in charge put it online again or just send it to the list please?
>
> So ZOO_CONNECTING_STATE is when I issue requests to the ZooKeeper server
> between zookeeper_init and  ZOO_CONNECTED_STATE. Did I get it right? My
> understanding of the ZOO_CONNECTING_STATE state so far was: The client
> ZooKeeper library tries to reconnect to the ZooKeeper und tries to
> reestablish a pending session. This then results in ZOO_CONNECTED_STATE
> or ZOO_EXPIRED_SESSION_STATE. So I guess I was wrong.
>
> regards,
> Jan
>
> 2011/2/2 Thijs Terlouw <th...@gmail.com>
>
> On Wed, Feb 2, 2011 at 7:24 PM, Ride Shoot Speak
>> <ri...@googlemail.com> wrote:
>> > Hi ZooKeepers,
>> >
>> > I'd like to get some information about the the states
>> ZOO_CONNECTING_STATE
>> > and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't
>> seem
>> > to find any information about those states. Right now I simply drop the
>> > connection if my callback is called with these states.
>> >
>> > TIA
>> > Jan
>>
>> Hi Jan,
>>
>> I would normally refer you to the state diagram of the ZooKeeper
>> states, but it seems not to be working (
>> http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A1 )
>>
>> ZOO_CONNECTING_STATE : This is when you try to send a request to the
>> ZooKeeper server, when the client library is still actively connecting
>> to a server (Session establishment is asynchronous). Requests will be
>> queued. If the connection attempt fails, any requests fail with
>> CONNECTION_LOSS
>>
>> ZOO_ASSOCIATING_STATE : I believe the handshake between the client and
>> the server is still in progress, also part of the connection process.
>>
>> I only handle ZOO_EXPIRED_SESSION_STATE (need to explicitly make a new
>> zookeeper connection) and ZOO_CONNECTED_STATE (client library is ready
>> to be used) explicitly in my client code (I don't use authentication
>> so can ignore ZOO_AUTH_FAILED_STATE)
>>
>> --
>> Thijs Terlouw,
>> Shenzhen, China
>> http://www.startinchina.com
>>
>
>

Re: How to handle ZOO_CONNECTING_STATE and ZOO_ASSOCIATING_STATE?

Posted by Ride Shoot Speak <ri...@googlemail.com>.
Hi Thijs,

thanks for the information. A state diagram would help me a lot. Can someone
in charge put it online again or just send it to the list please?

So ZOO_CONNECTING_STATE is when I issue requests to the ZooKeeper server
between zookeeper_init and  ZOO_CONNECTED_STATE. Did I get it right? My
understanding of the ZOO_CONNECTING_STATE state so far was: The client
ZooKeeper library tries to reconnect to the ZooKeeper und tries to
reestablish a pending session. This then results in ZOO_CONNECTED_STATE
or ZOO_EXPIRED_SESSION_STATE. So I guess I was wrong.

regards,
Jan

2011/2/2 Thijs Terlouw <th...@gmail.com>

> On Wed, Feb 2, 2011 at 7:24 PM, Ride Shoot Speak
> <ri...@googlemail.com> wrote:
> > Hi ZooKeepers,
> >
> > I'd like to get some information about the the states
> ZOO_CONNECTING_STATE
> > and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't
> seem
> > to find any information about those states. Right now I simply drop the
> > connection if my callback is called with these states.
> >
> > TIA
> > Jan
>
> Hi Jan,
>
> I would normally refer you to the state diagram of the ZooKeeper
> states, but it seems not to be working (
> http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A1 )
>
> ZOO_CONNECTING_STATE : This is when you try to send a request to the
> ZooKeeper server, when the client library is still actively connecting
> to a server (Session establishment is asynchronous). Requests will be
> queued. If the connection attempt fails, any requests fail with
> CONNECTION_LOSS
>
> ZOO_ASSOCIATING_STATE : I believe the handshake between the client and
> the server is still in progress, also part of the connection process.
>
> I only handle ZOO_EXPIRED_SESSION_STATE (need to explicitly make a new
> zookeeper connection) and ZOO_CONNECTED_STATE (client library is ready
> to be used) explicitly in my client code (I don't use authentication
> so can ignore ZOO_AUTH_FAILED_STATE)
>
> --
> Thijs Terlouw,
> Shenzhen, China
> http://www.startinchina.com
>

Re: How to handle ZOO_CONNECTING_STATE and ZOO_ASSOCIATING_STATE?

Posted by Thijs Terlouw <th...@gmail.com>.
On Wed, Feb 2, 2011 at 7:24 PM, Ride Shoot Speak
<ri...@googlemail.com> wrote:
> Hi ZooKeepers,
>
> I'd like to get some information about the the states ZOO_CONNECTING_STATE
> and ZOO_ASSOCIATING_STATE and how to handle them appropriately. I can't seem
> to find any information about those states. Right now I simply drop the
> connection if my callback is called with these states.
>
> TIA
> Jan

Hi Jan,

I would normally refer you to the state diagram of the ZooKeeper
states, but it seems not to be working (
http://wiki.apache.org/hadoop/ZooKeeper/FAQ#A1 )

ZOO_CONNECTING_STATE : This is when you try to send a request to the
ZooKeeper server, when the client library is still actively connecting
to a server (Session establishment is asynchronous). Requests will be
queued. If the connection attempt fails, any requests fail with
CONNECTION_LOSS

ZOO_ASSOCIATING_STATE : I believe the handshake between the client and
the server is still in progress, also part of the connection process.

I only handle ZOO_EXPIRED_SESSION_STATE (need to explicitly make a new
zookeeper connection) and ZOO_CONNECTED_STATE (client library is ready
to be used) explicitly in my client code (I don't use authentication
so can ignore ZOO_AUTH_FAILED_STATE)

-- 
Thijs Terlouw,
Shenzhen, China
http://www.startinchina.com