TaiJuWu commented on code in PR #18526:
URL: https://github.com/apache/kafka/pull/18526#discussion_r2246880856
##########
clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java:
##########
@@ -681,7 +681,7 @@ else if (!maxReauthSet)
else
retvalSessionLifetimeMs =
zeroIfNegative(Math.min(credentialExpirationMs - authenticationEndMs,
connectionsMaxReauthMs));
- sessionExpirationTimeNanos = authenticationEndNanos + 1000 *
1000 * retvalSessionLifetimeMs;
+ sessionExpirationTimeNanos =
Math.addExact(authenticationEndNanos, Utils.msToNs(retvalSessionLifetimeMs));
Review Comment:
`Math.addExact` will throw `ArithmeticException` if `authenticationEndNanos`
is large but `retvalSessionLifetimeMs` is small.
Should we consider such case?
--
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]