[
https://issues.apache.org/jira/browse/KAFKA-13908?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Luke Chen updated KAFKA-13908:
------------------------------
Description:
Before [#11969|https://github.com/apache/kafka/pull/11969], We will throw an
{{ExecutionException(KafkaStorageException)}} in {{{}BrokerServer.startup{}}},
and we'll catch the exception and rethrow the cause by:
{code:java}
throw if (e.isInstanceOf[ExecutionException]) e.getCause else e{code}
[https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/Kafka.scala#L113]
After [#11969|https://github.com/apache/kafka/pull/11969], We will throw a
{{{}RuntimeException(ExecutionException(KafkaStorageException)){}}}. But the
catch logic didn't change. That means, if the exception is RuntimeException, we
won't throw only the cause, but all the exception chains.
We should update it and add tests for it.
was:
Before [#11969|https://github.com/apache/kafka/pull/11969], We will throw an
{{ExecutionException(KafkaStorageException)}} in {{{}BrokerServer.startup{}}},
and we'll catch the exception and rethrow the cause by:
{code:java}
throw if (e.isInstanceOf[ExecutionException]) e.getCause else e{code}
[https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/Kafka.scala#L113]
After [#11969|https://github.com/apache/kafka/pull/11969], We will throw a
\{{RuntimeException(ExecutionException(KafkaStorageException)). But the catch
logic didn't change. That means, if the exception is RuntimeException, we won't
throw only the cause, but all the exception chains. }}
We should update it and add tests for it.
> RuntimeException will be thrown in BrokerServer.startup, not the cause of
> exception
> -----------------------------------------------------------------------------------
>
> Key: KAFKA-13908
> URL: https://issues.apache.org/jira/browse/KAFKA-13908
> Project: Kafka
> Issue Type: Improvement
> Reporter: Luke Chen
> Priority: Major
> Labels: newbie
>
> Before [#11969|https://github.com/apache/kafka/pull/11969], We will throw an
> {{ExecutionException(KafkaStorageException)}} in
> {{{}BrokerServer.startup{}}}, and we'll catch the exception and rethrow the
> cause by:
> {code:java}
> throw if (e.isInstanceOf[ExecutionException]) e.getCause else e{code}
> [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/Kafka.scala#L113]
>
> After [#11969|https://github.com/apache/kafka/pull/11969], We will throw a
> {{{}RuntimeException(ExecutionException(KafkaStorageException)){}}}. But the
> catch logic didn't change. That means, if the exception is RuntimeException,
> we won't throw only the cause, but all the exception chains.
>
> We should update it and add tests for it.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)