Skip to content

root_agent: drop the unused require 'delegate' - #5712

Merged
Watson1978 merged 1 commit into
fluent:masterfrom
amatsuda:root-agent-drop-unused-delegate
Dec 2, 2026
Merged

Watson1978 merged 1 commit into
fluent:masterfrom
amatsuda:root-agent-drop-unused-delegate

Conversation

@amatsuda

@amatsuda amatsuda commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
None.

What this PR does / why we need it:
Removes require 'delegate' from lib/fluent/root_agent.rb. The require came in with the Label feature (6b37daa), but nothing in fluentd uses Delegator, SimpleDelegator or DelegateClass, in root_agent.rb or anywhere else under lib/. test/test_root_agent.rb passes without it (45 tests, 0 failures).

Docs Changes:
Not needed.

Release Note:
Not needed.

🤖 Generated with Claude Code

The require came in with the Label feature (6b37daa), but nothing in
fluentd uses Delegator, SimpleDelegator or DelegateClass, in
root_agent.rb or anywhere else under lib/.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Akira Matsuda <ronnie@dio.jp>

@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 removing the unused require. Approved as is.

Nothing under lib/ uses Delegator, SimpleDelegator or DelegateClass now. The last user, RootAgentProxyWithoutErrorCollector, was removed in 8d9bd84.

A compatibility note for the record. fluent-plugin-mutate_filter 1.0.7 uses SimpleDelegator without requiring delegate. In a normal setup, tzinfo loads delegate anyway, so nothing changes. tzinfo 2.x loads it through concurrent-ruby. tzinfo 1.1 and 1.2 load it through thread_safe 0.1.1 or later.

Older dependency sets do not load it. Examples are tzinfo 1.0.x, or tzinfo 1.1 or 1.2 with thread_safe 0.1.0. Our gemspec still allows them. With them, loading the plugin after fluent/engine or fluent/test now fails with uninitialized constant Fluent::Plugin::Mixin::SimpleDelegator (NameError). For example, fluent-plugin-config-format -f txt filter mutate and the plugin's tests fail. The fluentd command still works, because fluent/supervisor loads delegate through webrick and tempfile.

These versions are from 2012 and 2013, so I don't think we need to keep the require for them. If it ever matters, the plugin should require delegate itself.

@Watson1978 Watson1978 added this to the v1.21.0 milestone Dec 2, 2026
@Watson1978
Watson1978 merged commit c080d2d into fluent:master Dec 2, 2026
20 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

Development

Successfully merging this pull request may close these issues.

2 participants