Skip to content

Commit

Permalink
add comment for the intention of warning
Browse files Browse the repository at this point in the history
Signed-off-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
daipom committed Jan 27, 2023
1 parent 63e1418 commit 0807567
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/fluent/plugin/buf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}" }
Expand Down
2 changes: 2 additions & 0 deletions lib/fluent/plugin/buf_file_single.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}" }
Expand Down

0 comments on commit 0807567

Please sign in to comment.