Open xidiandb opened 3 years ago
Use the following, do not define multiple <worker 0>
.
<system>
workers 1
rpc_endpoint "#{ENV['POD_IP']}:24444"
</system>
<label @FLUENT_LOG>
<match fluent.*>
@type null
</match>
</label>
<worker 0>
<source>
@type sample
sample {"hello borg ooo":"world"}
rate 1
tag sample.ni.hao
</source>
<match sample.*.*>
@type stdout
</match>
</worker>
@kenhys But the first time it started, there was no problem, only on reload ,Moreover, my configuration is very complex, which is divided into multiple files, and some configurations cannot be written to a worker tag. I would like to know if this boot is ok and if it is a bug when it reloads
I want to add configuration dynamically by adding files, each with worker tags. Is that not supportive? But why is there no problem at startup, only on reload
Hmm, I've overlooked it.
https://github.com/fluent/fluentd/blob/master/lib/fluent/supervisor.rb#L290-L303
It seems that Fluent::Engine.reload_config
raise it.
I cannot reproduce it by HUP
signal, but can reproduce by USR2
signal.
There are 2 places which show such message:
and former one is used in this case.
Fluent::StaticConfigAnalysis
is used only on graceful-reload.
It's added for implementing graceful-reload feature.
<worker>
elements are parsed by the following code on start up. https://github.com/fluent/fluentd/blob/8f990b8e496833e89ec109c58494f72e4885b4ac/lib/fluent/root_agent.rb#L69-L124
Fluent::StaticConfigAnalysis
seems be quit different than it.
I want to add configuration dynamically by adding files, each with worker tags. Is that not supportive? But why is there no problem at startup, only on reload
Hmm, it's ambiguous whether multiple <worker>
for same ID is supported or not.
The duplication check is introduced at #2292 only for <worker n-m>
syntax.
<worker n>
syntax is allowed multiple both before & after it.
I think it would be better that check duplication for <worker n>
syntax too, but show only warning and don't block loading to keep compatibility.
Describe the bug
I used a configuration with the worker tag, which runs on startup but not on reload.
To Reproduce
Use my configuration to start and reload
Expected behavior
fluent/log.rb:371:error: Failed to reload config file: specified worker_id<0> collisions is detected on directive. Available worker id(s): []
Your Environment
Your Configuration
Your Error Log
Additional context
No response