You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "rajinisivaram (via GitHub)" <gi...@apache.org> on 2025/07/31 12:25:46 UTC

Re: [PR] KAFKA-19561: Set OP_WRITE interest after SASL reauthentication to resume pending writes [kafka]

rajinisivaram commented on code in PR #20258:
URL: https://github.com/apache/kafka/pull/20258#discussion_r2245231741


##########
clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java:
##########
@@ -382,6 +382,12 @@ private void setSaslState(SaslState saslState, AuthenticationException exception
         } else {
             this.saslState = saslState;
             LOG.debug("Set SASL server state to {} during {}", saslState, reauthInfo.authenticationOrReauthenticationText());
+            if (saslState == SaslState.COMPLETE) {
+                // make sure that any pending write is actually sent.
+                if (reauthInfo.reauthenticating()) {
+                    transportLayer.addInterestOps(SelectionKey.OP_WRITE);

Review Comment:
   If there is nothing to send, we will need to reset this somewhere (or set it here only if it was set before reauth). Otherwise poll may return early until this write interest is reset, even though there is nothing to read or write for this channel. Can we check that this doesn't cause unnecessary return from poll when there is nothing to send from the broker?



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org