You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2020/12/04 03:11:14 UTC

[GitHub] [helix] narendly edited a comment on pull request #1562: Fix ZkClient leakage by correctly setting usesExternalZkClient flag

narendly edited a comment on pull request #1562:
URL: https://github.com/apache/helix/pull/1562#issuecomment-738534952


   > A general question, I see some of verifiers use external client to be true, some are false. Is that on purpose? Could you elaborate more why we do this?
   
   Good question to ask here. 
   
   Some constructors have `usesExternalZkClient = false` and others have `usesExternalZkClient=true`. Why?
   
   The answer lies in where the ZkClient object is being passed in. You will see a pattern where the top-level, public constructors that accept an instance of `zkClient` (external zkclient) have the flag set to true, and the private constructors whose zkClient objects originate from the Builder (created from `createZkClient()` method) will have this flag set to false.
   
   The difference here is that if the flag is set to true, the zkclient will NOT be closed because it is an external ZkClient (that might be used elsewhere - we don't control the fate of this ZkClient). If the flat is set to false, then the ZkClient will be closed because we control this ZkClient (we created it).
   
   @dasahcc let me know if this clarifies it. I've added more descriptive comments.


----------------------------------------------------------------
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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org