Copilot commented on code in PR #23799:
URL: https://github.com/apache/kafka/pull/23799#discussion_r4524139239


##########
tools/src/main/java/org/apache/kafka/tools/ToolsUtils.java:
##########
@@ -154,4 +160,13 @@ public static <T> Set<T> minus(Set<T> set, T... toRemove) {
             res.remove(t);
         return res;
     }
+
+    public static long groupCommandTimeoutMs(OptionSet options, 
OptionSpec<Long> timeoutMsOpt, Properties adminClientProps) {
+        if (options.has(timeoutMsOpt))
+            return options.valueOf(timeoutMsOpt);
+        String defaultApiTimeoutMs = 
adminClientProps.getProperty(CommonClientConfigs.DEFAULT_API_TIMEOUT_MS_CONFIG);
+        if (defaultApiTimeoutMs != null)
+            return (Integer) 
ConfigDef.parseType(CommonClientConfigs.DEFAULT_API_TIMEOUT_MS_CONFIG, 
defaultApiTimeoutMs, ConfigDef.Type.INT);

Review Comment:
   With `config.providers` configured, a valid timeout such as 
`default.api.timeout.ms=${file:/path/timeouts.properties:timeout}` makes all 
three commands fail during construction when `--timeout` is omitted. 
`Admin.create` resolves the placeholder without changing the supplied 
`Properties`, so this helper parses the literal placeholder and throws 
`ConfigException`. Use the resolved Admin configuration while preserving 
explicit-option precedence and the 30-second fallback, and add a 
provider-backed regression test.



-- 
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]

Reply via email to