kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: Include the inner exception stack trace when re-throwing an exception

Open divijvaidya opened this issue 2 years ago • 6 comments

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.

divijvaidya avatar May 31 '22 10:05 divijvaidya

@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

divijvaidya avatar May 31 '22 13:05 divijvaidya

@hachikuji Please review. This should be a small one.

divijvaidya avatar Jun 08 '22 14:06 divijvaidya

Can this kind of problem be caught by spotbugs? manual checking is error prone.

Agreed @dengziming but unfortunately spotbugs isn't catching such errors.

divijvaidya avatar Jun 15 '22 11:06 divijvaidya

@mimaison perhaps you may want to look into this? This already has 2 approvals from non-committers.

divijvaidya avatar Jun 15 '22 11:06 divijvaidya

@ijuma I have addressed your comments. This is ready for your review (pending test run).

divijvaidya avatar Jun 22 '22 12:06 divijvaidya

@tombentley requesting code review bandwidth from you here. We already have 3 non-committer approvals on this one.

divijvaidya avatar Aug 04 '22 15:08 divijvaidya

Rebased with the latest trunk to resolve merge conflicts.

divijvaidya avatar Sep 27 '22 16:09 divijvaidya

I'm going to merge this PR this week if there's no more comments. Thanks.

showuon avatar Sep 28 '22 02:09 showuon