From 6145974fef05cc212ad78a87505f930c47ba26e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=B0=8F=E6=BC=AA?= <644120242@qq.com> Date: Sun, 20 Mar 2022 12:09:28 +0800 Subject: [PATCH] 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 --- .../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 b33b75c7106..e8d590eeb0e 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();