zookeeper-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Updated] (ZOOKEEPER-3135) ClientCnxnSocket#updateLastSendAndHeard() method update lastSend、lastHeard has some problem
Date Wed, 28 Aug 2019 06:06:00 GMT

     [ https://issues.apache.org/jira/browse/ZOOKEEPER-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

ASF GitHub Bot updated ZOOKEEPER-3135:
--------------------------------------
    Labels: pull-request-available  (was: )

> ClientCnxnSocket#updateLastSendAndHeard() method update lastSend、lastHeard has some
problem
> -------------------------------------------------------------------------------------------
>
>                 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
>
> 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.2#803003)

Mime
View raw message