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

firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • server

    Description

      look at the source code in the ClientCnxnSocketNetty.connect(InetSocketAddress):

      public void operationComplete(ChannelFuture channelFuture) throws Exception {
                  // this lock guarantees that channel won't be assgined after cleanup().
                  connectLock.lock();
                      try {
                          //----------------------
                          sendThread.primeConnection();
                          //-----------------------
                          firstConnect.countDown();
                          LOG.info("channel is connected: {}", channelFuture.getChannel());
                      } finally {
                          connectLock.unlock();
                      }
                  }
       });
      

      firstConnect.countDown() will not be executed where sendThread.primeConnection() has thrown an exception,it should be put into finally code block.

      Attachments

        Activity

          People

            Unassigned Unassigned
            maoling Ling Mao
            Votes:
            0 Vote for this issue
            Watchers:
            1 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 40m
                1h 40m