From f3c8f35b06ca5ec13aba2d208880903ba7662927 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Thu, 16 Jan 2025 12:14:36 +0900 Subject: [PATCH] out_file: remove workaround for Ruby 2.7 and 3.0 on macOS (#4770) **Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: Next fluentd version will drop support of Ruby 3.1 or below. Ref. https://github.com/fluent/fluentd/pull/4745 So, we can remove the workaround for Ruby 2.7 and 3.0 on macOS that added at https://github.com/fluent/fluentd/pull/3579 **Docs Changes**: **Release Note**: Signed-off-by: Shizuo Fujita --- lib/fluent/plugin/out_file.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/fluent/plugin/out_file.rb b/lib/fluent/plugin/out_file.rb index 19c0afa8ef..ae47114a20 100644 --- a/lib/fluent/plugin/out_file.rb +++ b/lib/fluent/plugin/out_file.rb @@ -189,13 +189,6 @@ def configure(conf) @dir_perm = system_config.dir_permission || Fluent::DEFAULT_DIR_PERMISSION @file_perm = system_config.file_permission || Fluent::DEFAULT_FILE_PERMISSION @need_lock = system_config.workers > 1 - - # https://github.com/fluent/fluentd/issues/3569 - @need_ruby_on_macos_workaround = false - if @append && Fluent.macos? - condition = Gem::Dependency.new('', [">= 2.7.0", "< 3.1.0"]) - @need_ruby_on_macos_workaround = true if condition.match?('', RUBY_VERSION) - end end def multi_workers_ready? @@ -244,12 +237,7 @@ def write(chunk) def write_without_compression(path, chunk) File.open(path, "ab", @file_perm) do |f| - if @need_ruby_on_macos_workaround - content = chunk.read() - f.puts content - else - chunk.write_to(f) - end + chunk.write_to(f) end end