[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15369430#comment-15369430
 ] 

Arshad Mohammad commented on ZOOKEEPER-2469:
--------------------------------------------

Thanks [~sershe] for reporting and working on this issue
Few comments on latest patch
# I think we should not exit the refresh thread, let it keep trying, there may 
be cases where relogin succeeds after few retries, for example relogin fails 
becuase of KDC is down so relogin will succeed when KDC is up. 
# Same as [~eribeiro] said, use {{immediateRetry}} in {{reLogin}} method. no 
need to pass the {{immediateRetry}} to {{hasSufficientTimeElapsed}} method

> infinite loop in ZK re-login
> ----------------------------
>
>                 Key: ZOOKEEPER-2469
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2469
>             Project: ZooKeeper
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>         Attachments: ZOOKEEPER-2469.01.patch, ZOOKEEPER-2469.patch
>
>
> {noformat}
>                         int retry = 1;
>                         while (retry >= 0) {
>                             try {
>                                 reLogin();
>                                 break;
>                             } catch (LoginException le) {
>                                 if (retry > 0) {
>                                     --retry;
>                                     // sleep for 10 seconds.
>                                     try {
>                                         Thread.sleep(10 * 1000);
>                                     } catch (InterruptedException e) {
>                                         LOG.error("Interrupted during login 
> retry after LoginException:", le);
>                                         throw le;
>                                     }
>                                 } else {
>                                     LOG.error("Could not refresh TGT for 
> principal: " + principal + ".", le);
>                                 }
>                             }
>                         }
> {noformat}
> will retry forever. Should return like the one above



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to