瀏覽代碼

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 <albinker@gmail.com>
Albin Kerouanton 3 年之前
父節點
當前提交
bd61629b6b
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      daemon/logger/fluentd/fluentd.go

+ 1 - 0
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