From 8e8f46b1cdae6e80ed0c1694222092a5206d37b7 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Fri, 28 Apr 2023 19:59:57 +0900 Subject: [PATCH] Fix ChunkMessagePackEventStreamer's invalid argument The argument `unpacker` of `ChunkMessagePackEventStreamer.each` seems to have been added in order to match the feature with `EventStream` at c6c6c038c5cacab6fcb9aa89a714d9366ac4902e. However, that previous implementation at that point does not work as expected. It has never causes any issues just because the argument was not used at all. It could be implemented so that this argument is used, but given that it has not been used so far, there is little need for it. Signed-off-by: Daijiro Fukuda --- lib/fluent/event.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fluent/event.rb b/lib/fluent/event.rb index db644ccf4d..b124d6d886 100644 --- a/lib/fluent/event.rb +++ b/lib/fluent/event.rb @@ -308,11 +308,13 @@ def ensure_decompressed! end module ChunkMessagePackEventStreamer - # chunk.extend(ChunkEventStreamer) + # chunk.extend(ChunkMessagePackEventStreamer) # => chunk.each{|time, record| ... } def each(unpacker: nil, &block) open do |io| - (unpacker || Fluent::MessagePackFactory.msgpack_unpacker(io)).each(&block) + # Note: If need to use `unpacker`, then implement it, + # e.g., `unpacker.feed_each(io.read, &block)` (Not tested) + Fluent::MessagePackFactory.msgpack_unpacker(io).each(&block) end nil end