Skip to content

MessagePackEventStream returns only first event #2099

@osela

Description

@osela

After calling any? or first() on an instance of MessagePackEventStream which contains multiple events, iterating over it using each returns only the first event and the stream size is 0.

Here is a minimal reproduction:

require 'fluent/event'

time = Fluent::EventTime.now
array_stream = Fluent::ArrayEventStream.new([[time, {'a' => 1}], [time, {'a' => 2}]])
mp_stream = Fluent::MessagePackEventStream.new(array_stream.to_msgpack_stream)

puts mp_stream.any?

puts mp_stream.size # Prints 0

mp_stream.each do |time|
  puts time # Executes only once
end

Commenting the call to any? makes it work as it should. Am I missing something here?
I noticed it trying to debug a specific filter directly following a forward-input.
I'm using fluentd 1.2.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions