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 <wangguoz@gmail.com>
This commit is contained in:
彭小漪 2022-03-20 12:09:28 +08:00 committed by GitHub
parent 8d6968e832
commit 6145974fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 1 deletions

View File

@ -213,7 +213,6 @@ public class PushHttpMetricsReporter implements MetricsReporter {
} }
} catch (Throwable t) { } catch (Throwable t) {
log.error("Error reporting metrics", t); log.error("Error reporting metrics", t);
throw new KafkaException("Failed to report current metrics", t);
} finally { } finally {
if (connection != null) { if (connection != null) {
connection.disconnect(); connection.disconnect();