From 6263f7454172b60e0ce8bee0acb57e4027d5a056 Mon Sep 17 00:00:00 2001 From: Fujimoto Seiji Date: Tue, 1 Nov 2022 19:20:49 +0900 Subject: [PATCH] out_file: Avoid performing multi-worker check in configure() The check did not work well with `` 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 `` directive is used. Fix this issue by avoiding faulty sanity check in `configure()`. Signed-off-by: Fujimoto Seiji --- lib/fluent/plugin/out_file.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/fluent/plugin/out_file.rb b/lib/fluent/plugin/out_file.rb index f0a6642208..7de4b90979 100644 --- a/lib/fluent/plugin/out_file.rb +++ b/lib/fluent/plugin/out_file.rb @@ -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?