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

Sergey Shelukhin commented on ZOOKEEPER-2469:
---------------------------------------------

The result will be different because it also sets the login time, which will 
not be done if we don't do it. 
It does two things:
1) When delaying, logs a message.
2) When not delaying, updates time.
So, it must be called in either case, and it must tell them apart (otherwise 
the message in (1) would be spurious).
I think it's good to roll this is cause you don't normally expect a hasBlah 
method to have side effects, hence the confusion. 
I wonder if it's such a big deal to just get rid of it since it's a private 
3-line method called on one place.


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