Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3135

update lastSend, lastHeard with current timestamp when client reconnects successfully

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      ClientCnxnSocket#updateLastSendAndHeard() method update lastSend、lastHeard to now:

       

      void updateLastSendAndHeard() {
          this.lastSend = now;
          this.lastHeard = now;
      }
      
      void updateNow() {
          now = Time.currentElapsedTime();
      }

      In SendThread#run() method, there are some place call updateLastSendAndHeard() method, simplified as follows:

       

      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();
          }
      }

       

      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.

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ykgarfield yangkun
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h