divijvaidya commented on code in PR #15030: URL: https://github.com/apache/kafka/pull/15030#discussion_r1434893044
########## tools/src/main/java/org/apache/kafka/tools/LeaderElectionCommand.java: ########## @@ -99,8 +99,12 @@ static void run(Duration timeoutMs, String... args) throws Exception { props.putAll(Utils.loadProps(commandOptions.getAdminClientConfig())); } props.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, commandOptions.getBootstrapServer()); - props.setProperty(AdminClientConfig.DEFAULT_API_TIMEOUT_MS_CONFIG, Long.toString(timeoutMs.toMillis())); - props.setProperty(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG, Long.toString(timeoutMs.toMillis() / 2)); + if (!props.containsKey(AdminClientConfig.DEFAULT_API_TIMEOUT_MS_CONFIG)) { + props.setProperty(AdminClientConfig.DEFAULT_API_TIMEOUT_MS_CONFIG, Long.toString(timeoutMs.toMillis())); + } + if (!props.containsKey(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG)) { + props.setProperty(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG, Long.toString(timeoutMs.toMillis() / 2)); Review Comment: while you are over here in this part of the code can you also make another change please? This should be Int.toString since request.timeout is an int. See: https://kafka.apache.org/documentation.html#producerconfigs_request.timeout.ms same for default.api.timeout.ms https://kafka.apache.org/documentation.html#adminclientconfigs_default.api.timeout.ms -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org