FrankYang0529 commented on code in PR #18526:
URL: https://github.com/apache/kafka/pull/18526#discussion_r2249256855


##########
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:
   @TaiJuWu Thanks for the review. This issue is to throw exception if 
`authenticationEndNanos` + `1000 * 1000 * retvalSessionLifetimeMs` is 
overflowed. The exception is expected, because we don't want to get an 
overflowed value.



-- 
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]

Reply via email to