You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "maoling (Jira)" <ji...@apache.org> on 2020/02/21 06:50:00 UTC
[jira] [Updated] (ZOOKEEPER-3135) update lastSend, lastHeard with
current timestamp when client reconnects successfully
[ https://issues.apache.org/jira/browse/ZOOKEEPER-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
maoling updated ZOOKEEPER-3135:
-------------------------------
Summary: update lastSend, lastHeard with current timestamp when client reconnects successfully (was: ClientCnxnSocket#updateLastSendAndHeard() method update lastSend、lastHeard has some problem)
> update lastSend, lastHeard with current timestamp when client reconnects successfully
> -------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-3135
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3135
> Project: ZooKeeper
> Issue Type: Bug
> Reporter: yangkun
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> ClientCnxnSocket#updateLastSendAndHeard() method update lastSend、lastHeard to now:
>
> {code:java}
> void updateLastSendAndHeard() {
> this.lastSend = now;
> this.lastHeard = now;
> }
> void updateNow() {
> now = Time.currentElapsedTime();
> }{code}
> In SendThread#run() method, there are some place call updateLastSendAndHeard() method, simplified as follows:
>
> {code:java}
> public void run() {
> clientCnxnSocket.updateNow();
> // place-1. update lastSend、lastHeard
> clientCnxnSocket.updateLastSendAndHeard();
> while (state.isAlive()) {
> try {
> // ...some operation
> startConnect(serverAddress);
> // place-2. update lastSend、lastHeard
> clientCnxnSocket.updateLastSendAndHeard();
> }
> }{code}
>
> If so, place-1 and place-2, the lastSend、lastHeard value is equals, However, between place-1 and place-2 has some operation,consume some time,it should actually be unequal.
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)