Skip to content

multi-process-workers: describe sections inside and outside <worker> - #726

Merged
Watson1978 merged 4 commits into
fluent:1.0from
NopeCharon:multi-process-workers-hybrid-config
Nov 25, 2026
Merged

Watson1978 merged 4 commits into
fluent:1.0from
NopeCharon:multi-process-workers-hybrid-config

Conversation

@NopeCharon

Copy link
Copy Markdown
Contributor

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:

  • Sections outside <worker> directives are configured in every worker.
  • Sections inside a <worker> directive are configured only in the workers it specifies.
  • Sections inside <worker> directives always come after the sections outside them, wherever the <worker> directive appears in the file. RootAgent#configure appends 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 @label instead. 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

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>
@netlify

netlify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

👷 Deploy request for fluentd-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit abb590a

@Watson1978 Watson1978 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread deployment/multi-process-workers.md Resolved
Comment thread deployment/multi-process-workers.md Resolved
Comment thread deployment/multi-process-workers.md Resolved
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>

@Watson1978 Watson1978 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread deployment/multi-process-workers.md Resolved
@Watson1978
Watson1978 merged commit 9485f31 into fluent:1.0 Nov 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants