You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/09/03 03:45:04 UTC

[GitHub] [zookeeper] yanllearnn opened a new pull request #1446: ZOOKEEPER-3916: if zkServer is null, don't accept connection for wasting resource

yanllearnn opened a new pull request #1446:
URL: https://github.com/apache/zookeeper/pull/1446


       ## when leader is shutdown or not voted yet
   ```
   Leader#shutdown ---> self.setZooKeeperServer(null) ---> NIOServerCnxnFactory.SelectorThread#run 
   ---> processAcceptedConnections ---> createConnection(zkServer=null) 
   ```
   
   ## when the client tries to connect that uninitialized server
   * origin, accept the connections immediately. When reading data check whether the zkServer is null or not. If null, throws exceptions and closes connections, which wastes the resources.
   ```
   NIOServerCnxn#doIO---> NIOServerCnxn#readLength ---> 
   if (!isZKServerRunning()) ---> throw new IOException("ZooKeeperServer not running")
   ```
   * current, precheck whether the zkServer is null or not. If null, not accept the connetion.
   ```
   QuorumPeerMain#quorumPeer.start();--->QuorumPeer#startServerCnxnFactory();--->ServerCnxnFactory#start();--->
   acceptThread.start(); then thread is running waiting for connection to accepted; 
   --->AcceptThread#run, if (zkServer == null) continue; don't accept the connection, until zkServer is not null
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zookeeper] yanllearnn closed pull request #1446: ZOOKEEPER-3916: if zkServer is null, don't accept connection for wasting resource

Posted by GitBox <gi...@apache.org>.
yanllearnn closed pull request #1446:
URL: https://github.com/apache/zookeeper/pull/1446


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [zookeeper] yanllearnn commented on pull request #1446: ZOOKEEPER-3916: if zkServer is null, don't accept connection for wasting resource

Posted by GitBox <gi...@apache.org>.
yanllearnn commented on pull request #1446:
URL: https://github.com/apache/zookeeper/pull/1446#issuecomment-686279143


    The Travis CI build failed,


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org