diff --git a/lib/fluent/root_agent.rb b/lib/fluent/root_agent.rb index 3d839816ba..2ea9483a48 100644 --- a/lib/fluent/root_agent.rb +++ b/lib/fluent/root_agent.rb @@ -136,9 +136,12 @@ def lifecycle(desc: false, kind_callback: nil) def start lifecycle(desc: true) do |i| # instance i.start unless i.started? - # Input#start emits lots of evetns with in_tail/`read_from_head true` case and - # it causes deadlock for small buffer/queue output. To avoid such problem, + # Input#start sometimes emits lots of evetns with in_tail/`read_from_head true` case + # and it causes deadlock for small buffer/queue output. To avoid such problem, # buffer related output threads should be run before `Input#start`. + # This is why after_start should be called immediately after start call. + # This depends on `desc: true` because calling plugin order of `desc: true` is + # Output, Filter, Label, Output with Router and Input. i.after_start unless i.after_started? end end