[
https://issues.apache.org/jira/browse/KAFKA-20078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chih-Yuan Chien updated KAFKA-20078:
------------------------------------
Description:
`Exit.exit` should only be called from `main`. Helpers in `CommandLineUtils`
(`maybePrintHelpOrVersion`, `checkRequiredArgs`, `checkInvalidArgs`,
`checkInvalidArgsSet`, `checkOneOfArgs`, `initializeBootstrapProperties`)
terminated the JVM directly, which defeated the `mainNoExit` pattern and made
the validation/usage paths untestable without `Exit.setExitProcedure`.
was:
Currently, `DumpLogSegments` didn't return exit code properly.
The tool should return exit code 0 on success and non-zero (e.g., 1) on
failure, similar to other Kafka CLI tools that use Exit.exit() like
GetOffsetShell.
Add {{mainNoExit}} pattern to AclCommand, JmxTool,
ReassignPartitionsCommand, ShareGroupCommand and ConsumerGroupCommand.
Summary: Remove `Exit.exit` from `tools (was: Fix exit codes in CLI
tools using mainNoExit pattern)
> Remove `Exit.exit` from `tools
> ------------------------------
>
> Key: KAFKA-20078
> URL: https://issues.apache.org/jira/browse/KAFKA-20078
> Project: Kafka
> Issue Type: Improvement
> Reporter: Chih-Yuan Chien
> Assignee: Chih-Yuan Chien
> Priority: Trivial
>
> `Exit.exit` should only be called from `main`. Helpers in `CommandLineUtils`
> (`maybePrintHelpOrVersion`, `checkRequiredArgs`, `checkInvalidArgs`,
> `checkInvalidArgsSet`, `checkOneOfArgs`, `initializeBootstrapProperties`)
> terminated the JVM directly, which defeated the `mainNoExit` pattern and
> made
> the validation/usage paths untestable without `Exit.setExitProcedure`.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)