rajinisivaram commented on code in PR #16724:
URL: https://github.com/apache/kafka/pull/16724#discussion_r1697348597
##########
clients/src/main/java/org/apache/kafka/common/security/authenticator/LoginManager.java:
##########
@@ -55,13 +59,17 @@ public class LoginManager {
private int refCount;
private LoginManager(JaasContext jaasContext, String saslMechanism,
Map<String, ?> configs,
- LoginMetadata<?> loginMetadata) throws LoginException
{
+ LoginMetadata<?> loginMetadata) throws LoginException {
this.loginMetadata = loginMetadata;
this.login = Utils.newInstance(loginMetadata.loginClass);
loginCallbackHandler =
Utils.newInstance(loginMetadata.loginCallbackClass);
loginCallbackHandler.configure(configs, saslMechanism,
jaasContext.configurationEntries());
login.configure(configs, jaasContext.name(),
jaasContext.configuration(), loginCallbackHandler);
- login.login();
+ try (AutoCloseable loginResources = this::closeResources) {
Review Comment:
Should we move `login.configure` and `loginCallbackHandler.configure` into
the try-catch block so that we cleanup if either fails?
--
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]