Skip to content

KAFKA-20078: Fix DumpLogSegments to return proper exit codes#21907

Open
joshua2519 wants to merge 4 commits intoapache:trunkfrom
joshua2519:KAFKA-20078
Open

KAFKA-20078: Fix DumpLogSegments to return proper exit codes#21907
joshua2519 wants to merge 4 commits intoapache:trunkfrom
joshua2519:KAFKA-20078

Conversation

@joshua2519
Copy link
Copy Markdown
Contributor

  • 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

@github-actions github-actions bot added triage PRs from the community tools labels Mar 31, 2026
Copy link
Copy Markdown
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for @joshua2519 patch, could you also check the following tools

  • ConsumerGroupCommand.java
  • ShareGroupCommand.java
  • AclCommand.java
  • ReassignPartitionsCommand.java
  • JmxTool.java

@github-actions github-actions bot removed the triage PRs from the community label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants