You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by 蒋家福 <ji...@sugon.com> on 2017/05/04 06:34:04 UTC

回复: Is it good for Session management to use system time ?

Michael Han:


I'm using ZooKeeper 3.4.9 .
Will this problem be fixed in 3.4.X??


JiangJiafu




------------------ 原始邮件 ------------------
发件人: "Michael Han";<ha...@cloudera.com>;
发送时间: 2017年5月3日(星期三) 晚上11:50
收件人: "dev"<de...@zookeeper.apache.org>; 

主题: Re: Is it good for Session management to use system time ?



>> I think it may be better to use System.nanoTime() because it can achieve
the same goal without any problem.
Yes, and this has been fixed in ZOOKEEPER-1366 which is included in 3.5.1
and later versions. Which version of ZK you are using?

On Wed, May 3, 2017 at 1:09 AM, 蒋家福 <ji...@sugon.com> wrote:

> Hi,
>
> I'm using ZooKeepr in a multi-node environment, I found that if the
> machine time changes, the ephemeral node may exist for a long time even
> that the client has disconnected with ZooKeeper server.
> I read the source code and I find that the SessionTracker use
> System.currentTimeMills() to record the time. I think it may be better to
> use System.nanoTime() because it can achieve the same goal without any
> problem.
> I don't know whether I'm right. Can anyone give me suggestions?
>
>
>
> JiangJiafu




-- 
Cheers
Michael.

Re: Is it good for Session management to use system time ?

Posted by Michael Han <ha...@cloudera.com>.
Hi JiangJiafu:

>> Will this problem be fixed in 3.4.X??
According to ZOOKEEPER-1366 [1] the fix was not committed to 3.4 because
folks wanted to stabilize 3.4 and avoid big change but that concern is not
an issue anymore given 3.4 has been stable for quite sometime.

Are you interested in contributing the fix here? If so there is also a
patch attached in the JIRA targeted 3.4 that you can start work on. See [2]
on how to participate and contribute code.

[1] https://issues.apache.org/jira/browse/ZOOKEEPER-1366
[2] https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute


On Wed, May 3, 2017 at 11:34 PM, 蒋家福 <ji...@sugon.com> wrote:

> Michael Han:
>
>
> I'm using ZooKeeper 3.4.9 .
> Will this problem be fixed in 3.4.X??
>
>
> JiangJiafu
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Michael Han";<ha...@cloudera.com>;
> 发送时间: 2017年5月3日(星期三) 晚上11:50
> 收件人: "dev"<de...@zookeeper.apache.org>;
>
> 主题: Re: Is it good for Session management to use system time ?
>
>
>
> >> I think it may be better to use System.nanoTime() because it can achieve
> the same goal without any problem.
> Yes, and this has been fixed in ZOOKEEPER-1366 which is included in 3.5.1
> and later versions. Which version of ZK you are using?
>
> On Wed, May 3, 2017 at 1:09 AM, 蒋家福 <ji...@sugon.com> wrote:
>
> > Hi,
> >
> > I'm using ZooKeepr in a multi-node environment, I found that if the
> > machine time changes, the ephemeral node may exist for a long time even
> > that the client has disconnected with ZooKeeper server.
> > I read the source code and I find that the SessionTracker use
> > System.currentTimeMills() to record the time. I think it may be better to
> > use System.nanoTime() because it can achieve the same goal without any
> > problem.
> > I don't know whether I'm right. Can anyone give me suggestions?
> >
> >
> >
> > JiangJiafu
>
>
>
>
> --
> Cheers
> Michael.
>



-- 
Cheers
Michael.