showuon commented on code in PR #12179:
URL: https://github.com/apache/kafka/pull/12179#discussion_r887787750
##########
clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java:
##########
@@ -679,10 +679,11 @@ private long
calcCompletionTimesAndReturnSessionLifetimeMs() {
else if (connectionsMaxReauthMs == null)
retvalSessionLifetimeMs =
zeroIfNegative(credentialExpirationMs - authenticationEndMs);
else
- retvalSessionLifetimeMs = zeroIfNegative(
- Math.min(credentialExpirationMs -
authenticationEndMs, connectionsMaxReauthMs));
+ retvalSessionLifetimeMs =
zeroIfNegative(Math.min(credentialExpirationMs - authenticationEndMs,
connectionsMaxReauthMs));
- sessionExpirationTimeNanos = authenticationEndNanos + 1000 *
1000 * retvalSessionLifetimeMs;
+ if (connectionsMaxReauthMs != null) {
Review Comment:
Also, the debug line in L698 confused me a little. When
`credentialExpirationMs != null && sessionExpirationTimeNanos == null`, we'll
log:
```
"Authentication complete; session max lifetime from broker config={} ms,
credential expiration={} ({} ms); no session expiration, sending 0 ms to client"
```
The point I'm confused here is `no session expiration`. Why no session
expiration? Since `credentialExpirationMs != null`, there must be some
credential expiration time, so in this case, sending 0 to client doesn't make
sense to me, right? I think the log should also be updated. WDYT?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]