From 0807567b538f39db5a6e9be9e87b94f9c269f6e0 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Fri, 27 Jan 2023 13:49:06 +0900 Subject: [PATCH] add comment for the intention of warning Signed-off-by: Daijiro Fukuda --- lib/fluent/plugin/buf_file.rb | 2 ++ lib/fluent/plugin/buf_file_single.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/fluent/plugin/buf_file.rb b/lib/fluent/plugin/buf_file.rb index de8a22e0e6..70e086d40d 100644 --- a/lib/fluent/plugin/buf_file.rb +++ b/lib/fluent/plugin/buf_file.rb @@ -146,6 +146,8 @@ def resume next unless File.file?(path) if owner.respond_to?(:buffer_config) && owner.buffer_config&.flush_at_shutdown + # When `flush_at_shutdown` is `true`, the remaining chunk files during resuming are possibly broken + # since there may be a power failure or similar failure. log.warn { "restoring buffer file: path = #{path}" } else log.debug { "restoring buffer file: path = #{path}" } diff --git a/lib/fluent/plugin/buf_file_single.rb b/lib/fluent/plugin/buf_file_single.rb index 600f8945f6..1d974962a7 100644 --- a/lib/fluent/plugin/buf_file_single.rb +++ b/lib/fluent/plugin/buf_file_single.rb @@ -167,6 +167,8 @@ def resume next unless File.file?(path) if owner.respond_to?(:buffer_config) && owner.buffer_config&.flush_at_shutdown + # When `flush_at_shutdown` is `true`, the remaining chunk files during resuming are possibly broken + # since there may be a power failure or similar failure. log.warn { "restoring buffer file: path = #{path}" } else log.debug { "restoring buffer file: path = #{path}" }