Skip to content

Commit 75949b4

Browse files
Update clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java
Co-authored-by: refacto-visz[bot] <230139763+refacto-visz[bot]@users.noreply.github.com>
1 parent ffa68e2 commit 75949b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,12 @@ else if (!maxReauthSet)
681681
else
682682
retvalSessionLifetimeMs = zeroIfNegative(Math.min(credentialExpirationMs - authenticationEndMs, connectionsMaxReauthMs));
683683

684-
sessionExpirationTimeNanos = Math.addExact(authenticationEndNanos, Utils.msToNs(retvalSessionLifetimeMs));
684+
try {
685+
sessionExpirationTimeNanos = Math.addExact(authenticationEndNanos, Utils.msToNs(retvalSessionLifetimeMs));
686+
} catch (IllegalArgumentException e) {
687+
log.warn("Session lifetime too large, setting to maximum allowed value", e);
688+
sessionExpirationTimeNanos = Long.MAX_VALUE;
689+
}
685690
}
686691

687692
if (credentialExpirationMs != null) {

0 commit comments

Comments
 (0)