Yes, I believe that typically Zookeeper uses an infinite retry to connect in all circumstances. It will retry infinitely when the Zookeeper server goes down and infinitely even if the Zookeeper client configuration was wrong and fails to initially connect in the first place. Authentication does seem like a case where if it's failing repeatedly, there could be some failure case handled and stop reconnection attempts and notify the NiFi administrator, but I don't believe this is the case currently. Error handling for Zookeeper is something we can improve on, as at the moment the multiple retries seem to spam logs for me. I will create a Jira to investigate logging/error handling for Zookeeper.
Nathan On Wed, May 25, 2022 at 6:36 PM Rahul Rane <rr...@linkedin.com.invalid> wrote: > Hello team, > > > > We need some help in understanding the zookeeper expected behavior and > potential solution to the problem. > > > > Context : > > We have extended ServerAuthenticationProvider with x509 scheme based on > 3.6.3 zookeeper server. We are trying to understand connection retry > scenario. On auth failure, we see that zookeeper client retries to > establish connection with server until the timeout or infinitely if no > timeout is set. We are using > org.apache.zookeeper.server.NettyServerCnxnFactory as Server connection > factory. > > > > Couple of questions : > > 1. Is zookeeper client supposed to retry infinitely on auth failure > from zookeeper server? > 2. Is there a way zookeeper client does not perform infinitely retries > on auth failure errors and bails out after first auth failure itself? > 3. We can’t find anything about auth failure errors in zookeeper client > logs but just that connection is closed. After looking into Netty Server > code, we see the auth failure is not communicated to client but got masked > here< > https://github.com/linkedin/zookeeper/blob/8bcaf7bb3cfa6470e1660e2b36964ae2284197df/zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxn.java#L99>. > So we were wondering if we are missing something here? > > > > Thanks for the help and let me know if you need any clarification on any > of the questions. > > > > Thanks, > > Rahul Rane >