kafka
kafka copied to clipboard
MINOR: Include the inner exception stack trace when re-throwing an exception
Problem:
While wrapping the caught exception into a custom one, information about the caught exception is being lost, including information about the stack trace of the exception.
Change
When re-throwing an exception, we make sure to include the stack trace. Otherwise pertinent debug information is lost.
@dengziming @hachikuji kindly review.
Reviewer(s) please note that all tests failing for this CI are known to be flaky and are not related to this code change.
Test 1 - testListenerConnectionRateLimitWhenActualRateAboveLimit - fix is pending PR review https://github.com/apache/kafka/pull/12045
Test 2 - testTopicIdUpgradeAfterReassigningPartitions - fix is pending PR review https://github.com/apache/kafka/pull/11687
Test 3 - testSnapshotOnlyAfterConfiguredMinBytes - (possible) fix is pending PR review https://github.com/apache/kafka/pull/12224
Test 4 - Created a ticket at https://issues.apache.org/jira/browse/KAFKA-13951
@hachikuji Please review. This should be a small one.
Can this kind of problem be caught by spotbugs? manual checking is error prone.
Agreed @dengziming but unfortunately spotbugs isn't catching such errors.
@mimaison perhaps you may want to look into this? This already has 2 approvals from non-committers.
@ijuma I have addressed your comments. This is ready for your review (pending test run).
@tombentley requesting code review bandwidth from you here. We already have 3 non-committer approvals on this one.
Rebased with the latest trunk
to resolve merge conflicts.
I'm going to merge this PR this week if there's no more comments. Thanks.