Repository navigation
multi-process-workers: describe sections inside and outside <worker> - #726
Conversation
The article shows a configuration which mixes sections inside and outside <worker> directives, but it never says how each worker loads them. RootAgent#configure keeps the sections outside <worker> directives without a target worker id, so every worker configures them. The children of each <worker> directive are appended to the root configuration and the <worker> wrapper is removed, so they always come after the sections outside <worker> directives, wherever the <worker> directive is written. Since <match> sections are evaluated in that order and the first match wins, a broad <match> outside <worker> takes the events of a <source> inside <worker> even when the <worker> directive comes first in the file. Describe this with an example and show how to route the events with @Label instead. Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
👷 Deploy request for fluentd-docs pending review.Visit the deploys page to approve it
|
Watson1978
left a comment
There was a problem hiding this comment.
Thanks for writing this up. The three rules match RootAgent#configure, which has handled <worker> this way since v1.0.0. Both examples also behave as described on Fluentd v1.20.1 with two workers.
Please add a short note about copying the @label example into another <worker> directive. Fluentd fails to start in that case unless a few names are changed. Details are in the comment on the last paragraph. The other two comments are small suggestions.
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Watson1978
left a comment
There was a problem hiding this comment.
Thanks for the update. All three points are addressed.
I found two small problems in the wording I suggested for the note after the second example, so I left a fix for it. Sorry about that. It is a small change, so I am approving now.
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
The Multi Process Workers article shows a configuration that mixes sections inside and outside
<worker>directives, but it never says how each worker loads them. This adds a subsection with the three points from the analysis in #326:<worker>directives are configured in every worker.<worker>directive are configured only in the workers it specifies.<worker>directives always come after the sections outside them, wherever the<worker>directive appears in the file.RootAgent#configureappends the children of each<worker>to the root configuration and then removes the wrapper.Because
<match>sections are evaluated in that order and the first match wins, a broad<match>outside<worker>takes the events of a<source>inside<worker>, even when the<worker>directive is written first. The subsection shows this with an example and shows how to route the events with@labelinstead. It also notes that a<source>outside<worker>directives listens in every worker, which explains the port behavior in the report.I ran both examples with Fluentd v1.19.0 and two workers. In the first, the events go to
<match app.**>and the file output inside<worker 0>receives nothing. In the second, they go to the file output inside<worker 0>and nothing reaches stdout. The new links and anchors resolve in a HonKit build.Fixes #326