lib/fluent/buffer.rb in fluentd-0.10.22 vs lib/fluent/buffer.rb in fluentd-0.10.23

- old
+ new

@@ -125,12 +125,15 @@ def enable_parallel(b=true) @parallel_pop = b end - config_param :buffer_chunk_limit, :size, :default => 256*1024*1024 - config_param :buffer_queue_limit, :integer, :default => 128 + # This configuration assumes plugins to send records to a remote server. + # Local file based plugins which should provide more reliability and efficiency + # should override buffer_chunk_limit with a larger size. + config_param :buffer_chunk_limit, :size, :default => 8*1024*1024 + config_param :buffer_queue_limit, :integer, :default => 256 alias chunk_limit buffer_chunk_limit alias chunk_limit= buffer_chunk_limit= alias queue_limit buffer_queue_limit alias queue_limit= buffer_queue_limit= @@ -189,17 +192,19 @@ begin nc << data chain.next + flush_trigger = false @queue.synchronize { enqueue(top) + flush_trigger = @queue.empty? @queue << top @map[key] = nc } ok = true - return @queue.size == 1 + return flush_trigger ensure nc.purge unless ok end end # synchronize