From f9df098e7684fb42287860377dcd6931cca62a73 Mon Sep 17 00:00:00 2001 From: Albin Kerouanton Date: Mon, 1 Nov 2021 10:44:07 +0100 Subject: [PATCH] fluentd: Turn ForceStopAsyncSend true when async connect is used The flag ForceStopAsyncSend was added to fluent logger lib in v1.5.0 (at this time named AsyncStop) to tell fluentd to abort sending logs asynchronously as soon as possible, when its Close() method is called. However this flag was broken because of the way the lib was handling it (basically, the lib could be stucked in retry-connect loop without checking this flag). Since fluent logger lib v1.7.0, calling Close() (when ForceStopAsyncSend is true) will really stop all ongoing send/connect procedure, wherever it's stucked. Signed-off-by: Albin Kerouanton (cherry picked from commit bd61629b6b009b5fa50e31c180e86cede86ce9de) Signed-off-by: Wesley --- daemon/logger/fluentd/fluentd.go | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/logger/fluentd/fluentd.go b/daemon/logger/fluentd/fluentd.go index 829b606c9f3f8..997c01c65257e 100644 --- a/daemon/logger/fluentd/fluentd.go +++ b/daemon/logger/fluentd/fluentd.go @@ -242,6 +242,7 @@ func parseConfig(cfg map[string]string) (fluent.Config, error) { AsyncConnect: asyncConnect, SubSecondPrecision: subSecondPrecision, RequestAck: requestAck, + ForceStopAsyncSend: async || asyncConnect, } return config, nil