You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Karan Mehta <k....@salesforce.com.INVALID> on 2019/12/12 04:14:58 UTC

clientCnxnSocket#updateLastSendAndHeard() method usage

Hello,

On this line in ClientCnxn.java
<https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java#L1183>,
we are calling clientCnxnSocket.updateLastSendAndHeard() method but we
didn't call clientCnxnSocket.updateNow() method before that. Is there a
possiblity that can result in incorrect calculation
of clientCnxnSocket.getIdleRecv(), causing it to
throw SessionTimeoutException?

-- 
Karan Mehta

<http://smart.salesforce.com/sig/k.mehta//us_mb/default/link.html>

Re: clientCnxnSocket#updateLastSendAndHeard() method usage

Posted by Michael Han <ha...@apache.org>.
We had some prod issues previously related to the usage of cached "now"
variable (and lacking of consistent accessing pattern for updateNow) used
in java client - we had a patch internally (basically what's described in
ZOOKEEPER-2471) that removed usage of the cache value and instead calculate
"now" whenever we need.

On Wed, Dec 11, 2019 at 8:35 PM Karan Mehta <k....@salesforce.com.invalid>
wrote:

> Hello,
>
> On this line in ClientCnxn.java
> <
> https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java#L1183
> >,
> we are calling clientCnxnSocket.updateLastSendAndHeard() method but we
> didn't call clientCnxnSocket.updateNow() method before that. Is there a
> possiblity that can result in incorrect calculation
> of clientCnxnSocket.getIdleRecv(), causing it to
> throw SessionTimeoutException?
>
> --
> Karan Mehta
>
> <http://smart.salesforce.com/sig/k.mehta//us_mb/default/link.html>
>