public boolean maybeBeginServerReauthentication(NetworkReceive saslHandshakeNetworkReceive,
            Supplier<Long> nowNanosSupplier) throws AuthenticationException, IOException {
        if (!ready())
            throw new IllegalStateException(
                    "KafkaChannel should be \"ready\" when processing SASL Handshake for potential re-authentication");
        /*
         * Re-authentication is disabled if there is no session expiration time, in
         * which case the SASL handshake network receive will be processed normally,
         * which results in a failure result being sent to the client. Also, no need to
         * check if we are muted since we are processing a received packet when we invoke
         * this.
         */
        if (authenticator.serverSessionExpirationTimeNanos() == null)
            return false;
        /*
         * We've delayed getting the time as long as possible in case we don't need it,
         * but at this point we need it -- so get it now.
         */
        long nowNanos = nowNanosSupplier.get();
        /*
         * Cannot re-authenticate more than once every second; an attempt to do so will
         * result in the SASL handshake network receive being processed normally, which
         * results in a failure result being sent to the client.
         */
        if (lastReauthenticationStartNanos != 0
                && nowNanos - lastReauthenticationStartNanos < MIN_REAUTH_INTERVAL_ONE_SECOND_NANOS)
            return false;
        lastReauthenticationStartNanos = nowNanos;
        swapAuthenticatorsAndBeginReauthentication(
                new ReauthenticationContext(authenticator, saslHandshakeNetworkReceive, nowNanos));
        return true;
    }
If this is a server-side connection that has an expiration time and at least
1 second has passed since the prior re-authentication (if any) started then
begin the process of re-authenticating the connection and return true,
otherwise return false

@param saslHandshakeNetworkReceive
           the mandatory {@link NetworkReceive} containing the
           {@code SaslHandshakeRequest} that has been received on the server
           and that initiates re-authentication.
@param nowNanosSupplier
           {@code Supplier} of the current time. The value must be in
           nanoseconds as per {@code System.nanoTime()} and is therefore only
           useful when compared to such a value -- it's absolute value is
           meaningless.

@return true if this is a server-side connection that has an expiration time
        and at least 1 second has passed since the prior re-authentication
        (if any) started to indicate that the re-authentication process has
        begun, otherwise false
@throws AuthenticationException
            if re-authentication fails due to invalid credentials or other
            security configuration errors
@throws IOException
            if read/write fails due to an I/O error
@throws IllegalStateException
            if this channel is not "ready"
clients/src/main/java/org/apache/kafka/common/network/KafkaChannel.java