You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Luke Chen (Jira)" <ji...@apache.org> on 2023/01/07 10:29:00 UTC
[jira] [Updated] (KAFKA-14604) SASL session expiration time will be overflowed when calculation
[ https://issues.apache.org/jira/browse/KAFKA-14604?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Luke Chen updated KAFKA-14604:
------------------------------
Description:
When sasl server of client set a large expiration time, the timeout value might be overflowed, and cause the session timeout immediately.
[Here|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java#L694]'s the sasl server timeout's calculation
[Here|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientAuthenticator.java#L692]'s the sasl client timeout's calculation
something like this:
{code:java}
sessionExpirationTimeNanos = authenticationEndNanos + 1000 * 1000 * sessionLifetimeMs; {code}
So, if the configured or returned sessionLifetimeMs is a large number, after the calculation, the `sessionExpirationTimeNanos` will be a negative value, and cause the session timeout each check.
was:
When sasl server of client set a large expiration time, the timeout value might be overflowed, and cause the session timeout immediately.
[Here|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java#L694]'s the sasl server timeout's calculation
[Here|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientAuthenticator.java#L692]'s the sasl client timeout's calculation
something like this:
{code:java}
sessionExpirationTimeNanos = authenticationEndNanos + 1000 * 1000 * sessionLifetimeMs; {code}
So, if the configured or returned sessionLifetimeMs is a large number, after the calculation, it'll be a negative value, and cause the session timeout each check.
> SASL session expiration time will be overflowed when calculation
> ----------------------------------------------------------------
>
> Key: KAFKA-14604
> URL: https://issues.apache.org/jira/browse/KAFKA-14604
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 3.3.1
> Reporter: Luke Chen
> Assignee: Luke Chen
> Priority: Major
>
> When sasl server of client set a large expiration time, the timeout value might be overflowed, and cause the session timeout immediately.
>
> [Here|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java#L694]'s the sasl server timeout's calculation
> [Here|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientAuthenticator.java#L692]'s the sasl client timeout's calculation
>
> something like this:
> {code:java}
> sessionExpirationTimeNanos = authenticationEndNanos + 1000 * 1000 * sessionLifetimeMs; {code}
> So, if the configured or returned sessionLifetimeMs is a large number, after the calculation, the `sessionExpirationTimeNanos` will be a negative value, and cause the session timeout each check.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)