From 5e09644af3458df377be6ff84cd77f4eb9bbd283 Mon Sep 17 00:00:00 2001 From: Tiago Queiroz Date: Fri, 18 Oct 2024 12:09:23 -0400 Subject: [PATCH] PR improvements --- CHANGELOG.next.asciidoc | 1 + heartbeat/beater/heartbeat.go | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 9804c8d929af..9eb7d746718f 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -122,6 +122,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff] - Closes beat Publisher on beat stop and by the Agent manager. {pull}40572[40572] - The journald input now restarts if there is an error/crash {issue}32782[32782] {pull}40558[40558] - Fix Elasticsearch output not recovering from network errors {issue}40705[40705] {pull}40794[40794] +- Ensure Elasticsearch output can always recover from network errors {pull}40794[40794] *Auditbeat* diff --git a/heartbeat/beater/heartbeat.go b/heartbeat/beater/heartbeat.go index e22503ed7413..227b375ee900 100644 --- a/heartbeat/beater/heartbeat.go +++ b/heartbeat/beater/heartbeat.go @@ -275,10 +275,7 @@ func (bt *Heartbeat) RunCentralMgmtMonitors(b *beat.Beat) { } // Backoff panics with 0 duration, set to smallest unit - // TODO(Tiago): find out the correct lifecycle for this context/connection - ctx, cancel := context.WithCancel(context.TODO()) - defer cancel() - esClient, err := makeESClient(ctx, outCfg.Config(), 1, 1*time.Nanosecond) + esClient, err := makeESClient(context.TODO(), outCfg.Config(), 1, 1*time.Nanosecond) if err != nil { logp.L().Warnf("skipping monitor state management during managed reload: %w", err) } else {