KAFKA-20078: Fix DumpLogSegments to return proper exit codes#21907
Open
joshua2519 wants to merge 4 commits intoapache:trunkfrom
Open
KAFKA-20078: Fix DumpLogSegments to return proper exit codes#21907joshua2519 wants to merge 4 commits intoapache:trunkfrom
joshua2519 wants to merge 4 commits intoapache:trunkfrom
Conversation
Contributor
joshua2519
commented
Mar 31, 2026
- Add mainNoExit pattern (matching other Kafka CLI tools like GetOffsetShell) so main returns exit code 0 on success and 1 on failure via Exit.exit()
- dumpProducerIdSnapshot: rethrow CorruptSnapshotException as TerseException instead of silently printing to stderr
- dumpTxnIndex: catch CorruptIndexException | KafkaException and rethrow as TerseException
- execute now throws TerseException when index mismatches, time index errors, or non-consecutive offsets are detected
- Update tests to use mainNoExit and assert exit codes instead of catching thrown exceptions
m1a2st
reviewed
Apr 1, 2026
Collaborator
m1a2st
left a comment
There was a problem hiding this comment.
Thanks for @joshua2519 patch, could you also check the following tools
- ConsumerGroupCommand.java
- ShareGroupCommand.java
- AclCommand.java
- ReassignPartitionsCommand.java
- JmxTool.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.