Skip to content

Commit

Permalink
buffer: warning message for restoring buffer with flush_at_shutdown
Browse files Browse the repository at this point in the history
Signed-off-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
daipom committed Jan 26, 2023
1 parent c48ca04 commit 63e1418
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/fluent/plugin/buf_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,11 @@ def resume
Dir.glob(escaped_patterns(patterns)) do |path|
next unless File.file?(path)

log.debug { "restoring buffer file: path = #{path}" }
if owner.respond_to?(:buffer_config) && owner.buffer_config&.flush_at_shutdown
log.warn { "restoring buffer file: path = #{path}" }
else
log.debug { "restoring buffer file: path = #{path}" }
end

m = new_metadata() # this metadata will be overwritten by resuming .meta file content
# so it should not added into @metadata_list for now
Expand Down
6 changes: 5 additions & 1 deletion lib/fluent/plugin/buf_file_single.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ def resume
Dir.glob(escaped_patterns(patterns)) do |path|
next unless File.file?(path)

log.debug { "restoring buffer file: path = #{path}" }
if owner.respond_to?(:buffer_config) && owner.buffer_config&.flush_at_shutdown
log.warn { "restoring buffer file: path = #{path}" }
else
log.debug { "restoring buffer file: path = #{path}" }
end

m = new_metadata() # this metadata will be updated in FileSingleChunk.new
mode = Fluent::Plugin::Buffer::FileSingleChunk.assume_chunk_state(path)
Expand Down

0 comments on commit 63e1418

Please sign in to comment.