kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: Catch InvocationTargetException explicitly and propagate underlying cause

Open divijvaidya opened this issue 3 years ago • 3 comments

InvocationTargetException always wraps an underlying cause. It makes sense to catch it as soon as possible and only propagate the underlying cause.

Change

  1. Replace "legacy" [1] with getCause()
  2. Propagate the cause after catching InvocationTargetException

[1] "legacy as per the docs" https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/InvocationTargetException.html

divijvaidya avatar May 31 '22 10:05 divijvaidya

@dengziming @showuon please review this small change.

divijvaidya avatar Jun 15 '22 11:06 divijvaidya

@mimaison kindly review when you get a chance.

divijvaidya avatar Aug 03 '22 09:08 divijvaidya

@showuon requesting for your code review time on this one. We already have two approvals from non-committers.

divijvaidya avatar Aug 04 '22 15:08 divijvaidya

The failing tests for JDK 11 are unrelated to the code changes.

Build / JDK 11 and Scala 2.13 / testLargeAssignmentAndGroupWithNonEqualSubscription() – org.apache.kafka.clients.consumer.StickyAssignorTest
1m 3s
Build / JDK 11 and Scala 2.13 / testPrepareJoinAndRejoinAfterFailedRebalance() – org.apache.kafka.clients.consumer.internals.EagerConsumerCoordinatorTest
<1s
Build / JDK 11 and Scala 2.13 / testTimeouts() – org.apache.kafka.controller.QuorumControllerTest

@ijuma @mimaison requesting your your time to review this. Please note that we have this triaged with two non-committers already.

divijvaidya avatar Aug 23 '22 08:08 divijvaidya