Skip to content

Commit

Permalink
fluentd: Turn ForceStopAsyncSend true when async connect is used
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit bd61629)
Signed-off-by: Wesley <wppttt@amazon.com>
  • Loading branch information
akerouanton authored and PettitWesley committed Jan 13, 2022
1 parent 81fc02b commit f9df098
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions daemon/logger/fluentd/fluentd.go
Expand Up @@ -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
Expand Down

1 comment on commit f9df098

@pekuz
Copy link

@pekuz pekuz commented on f9df098 Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might resolve #43482

That issue was tested with Docker 20.10.6, and by observation it does not force stop the log driver.

Please sign in to comment.