You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Sönke Liebau (Jira)" <ji...@apache.org> on 2020/03/11 21:01:00 UTC

[jira] [Commented] (KAFKA-1518) KafkaMetricsReporter prevents Kafka from starting if the custom reporter throws an exception

    [ https://issues.apache.org/jira/browse/KAFKA-1518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17057389#comment-17057389 ] 

Sönke Liebau commented on KAFKA-1518:
-------------------------------------

Personally I'd say, that this behavior is fine. If you don't want Kafka to stop then the reporter should catch and ignore the exception. But if an exception is propagated up to Kafka, then it shouldn't just be ignored.

> KafkaMetricsReporter prevents Kafka from starting if the custom reporter throws an exception
> --------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-1518
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1518
>             Project: Kafka
>          Issue Type: Bug
>          Components: tools
>    Affects Versions: 0.8.1.1
>            Reporter: Daniel Compton
>            Priority: Major
>
> When Kafka starts up, it [starts|https://github.com/apache/kafka/blob/0.8.1/core/src/main/scala/kafka/metrics/KafkaMetricsReporter.scala#L60] custom metrics reporters. If any of these throw an exception on startup then this will block Kafka from starting.
> For example using [kafka-riemann-reporter|https://github.com/pingles/kafka-riemann-reporter], if Riemann is not available then it will throw an [IO Exception|https://github.com/pingles/kafka-riemann-reporter/issues/1] which isn't caught by KafkaMetricsReporter. This means that Kafka will fail to start until it can connect to Riemann, coupling a HA system to a non HA system.
> It would probably be better to log the error and perhaps have a callback hook to the reporter where they can handle it and startup in the background.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)