lib/fluent/plugin/buf_file.rb in fluentd-0.14.1 vs lib/fluent/plugin/buf_file.rb in fluentd-0.14.2
- old
+ new
@@ -120,17 +120,20 @@
Dir.glob(@path) do |path|
m = new_metadata() # this metadata will be overwritten by resuming .meta file content
# so it should not added into @metadata_list for now
mode = Fluent::Plugin::Buffer::FileChunk.assume_chunk_state(path)
+ if mode == :unknown
+ log.debug "uknown state chunk found", path: path
+ next
+ end
+
chunk = Fluent::Plugin::Buffer::FileChunk.new(m, path, mode) # file chunk resumes contents of metadata
case chunk.state
when :staged
stage[chunk.metadata] = chunk
when :queued
queue << chunk
- else
- raise "BUG: unexpected chunk state '#{chunk.state}' for path '#{path}'"
end
end
queue.sort_by!{ |chunk| chunk.modified_at }