Skip to content

Commit

Permalink
out_file: Avoid performing multi-worker check in configure()
Browse files Browse the repository at this point in the history
The check did not work well with `<worker 0-N>` directive for
the following reasons:

 * When Fluentd starts up, supervisor performs sanity check on
   configuration by creating actual instances of plugins.

 * This check precedes SeverModule, which prepares various assets
   for workers (lockdir, RPC endpoints and shared sockets etc.)

 * Fluent::Plugin::Base dynamically overrides `system_config.workers`
   during start-up, and leaves the value > 1 only when `<worker 0-N>`
   directive is used.

Fix this issue by avoiding faulty sanity check in `configure()`.

Signed-off-by: Fujimoto Seiji <[email protected]>
  • Loading branch information
Fujimoto Seiji committed Nov 1, 2022
1 parent c328422 commit 6263f74
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/fluent/plugin/out_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ def configure(conf)
condition = Gem::Dependency.new('', [">= 2.7.0", "< 3.1.0"])
@need_ruby_on_macos_workaround = true if condition.match?('', RUBY_VERSION)
end

if @need_lock && @append && @fluentd_lock_dir.nil?
raise Fluent::InvalidLockDirectory, "must set FLUENTD_LOCK_DIR on multi-worker append mode"
end
end

def multi_workers_ready?
Expand Down

0 comments on commit 6263f74

Please sign in to comment.