You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2022/03/20 04:11:56 UTC

[kafka] branch trunk updated: KAFKA-13728: fix PushHttpMetricsReporter no longer pushes metrics when network failure is recovered. (#11879)

This is an automated email from the ASF dual-hosted git repository.

guozhang pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6145974  KAFKA-13728: fix PushHttpMetricsReporter no longer pushes metrics when network failure is recovered. (#11879)
6145974 is described below

commit 6145974fef05cc212ad78a87505f930c47ba26e7
Author: 彭小漪 <64...@qq.com>
AuthorDate: Sun Mar 20 12:09:28 2022 +0800

    KAFKA-13728: fix PushHttpMetricsReporter no longer pushes metrics when network failure is recovered. (#11879)
    
    The class PushHttpMetricsReporter no longer pushes metrics when network failure is recovered.
    
    I debugged the code and found the problem here: when we submit a task to the ScheduledThreadPoolExecutor that needs to be executed periodically, if the task throws an exception and is not swallowed, the task will no longer be scheduled to execute.
    
    So when an IO exception occasionally occurs on the network, we should swallow it rather than throw it in task HttpReporter.
    
    Reviewers: Guozhang Wang <wa...@gmail.com>
---
 tools/src/main/java/org/apache/kafka/tools/PushHttpMetricsReporter.java | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/src/main/java/org/apache/kafka/tools/PushHttpMetricsReporter.java b/tools/src/main/java/org/apache/kafka/tools/PushHttpMetricsReporter.java
index b33b75c..e8d590e 100644
--- a/tools/src/main/java/org/apache/kafka/tools/PushHttpMetricsReporter.java
+++ b/tools/src/main/java/org/apache/kafka/tools/PushHttpMetricsReporter.java
@@ -213,7 +213,6 @@ public class PushHttpMetricsReporter implements MetricsReporter {
                 }
             } catch (Throwable t) {
                 log.error("Error reporting metrics", t);
-                throw new KafkaException("Failed to report current metrics", t);
             } finally {
                 if (connection != null) {
                     connection.disconnect();