You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to asynchronously connect to Fluentd before writing
PR fluent#77 introduced a new parameter named ForceStopAsyncSend. It can be
used to tell the logger to not try to send all the log messages in its
buffer before closing. Without this parameter, the logger hangs out
whenever it has logs to write and the target Fluentd server is down.
But this new parameter is not enough: the connection is currently lazily
initialized when the logger receive its first message. This blocks the
select reading messages from the queue (until the connection is ready).
Moreover, the connection dialing uses an exponential back-off retry.
Because of that, the logger won't look for messages on `stopRunning`
channel (the channel introduced by PR fluent#77), either because it's
blocked by the Sleep used for the retry or because the connection
dialing is waiting for tcp timeout.
To fix these edge cases, the connection isn't initialized lazily
anymore. However, it's still initialized asynchronously and with the
exponential back-off retry. The Fluent.run() method has been adapted to
wait for either the connection to become ready or to receive a stop
signal on the stopRunning channel before starting to unqueue logs.
This fix is motivated by the issue described in: moby/moby#40063.
Signed-off-by: Albin Kerouanton <[email protected]>
0 commit comments