Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confusing retry behavior of reLogin() function in KerberosLogin class #21

Open
ppeter opened this issue Jun 22, 2021 · 0 comments
Open

Comments

@ppeter
Copy link

ppeter commented Jun 22, 2021

In the class KerberosLogin (https://github.com/a0x8o/kafka/blob/master/clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosLogin.java) in the while-loop where the method reLogin is called, there is a retry mechanism that I believe does not work as expected:

If the first reLogin() call fails the function waits for 10 seconds an afterwards calls the reLogin() method is called a second time. In the reLogin() method there is a hasSufficientTimeElapsed() check and after 10 seconds this method usually evaluates to false, as the minTimeBeforeRelogin is by default 1 minute and thus much larger than 10 seconds. As minTimeBeforeRelogin is a long variable it is not even possible to set it to e.g. 5 seconds. The only value for minTimeBeforeReloing does not prematurely stop the second reLogin() call is 0.

This retry behavior is in my opinion confusing as the retry effectively has no effect if minTimBeforeRelogin is not set to 0, which is not even the default value.

I suggest to either

  • remove the retry mechanism or
  • handle minTimeBeforeRelogin more consistently in case of a retry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant