Skip to content

in_forward: enable skip_invalid_event by default #5003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ForwardInput < Input
desc 'Received chunk is dropped if it is larger than this value.'
config_param :chunk_size_limit, :size, default: nil
desc 'Skip an event if incoming event is invalid.'
config_param :skip_invalid_event, :bool, default: false
config_param :skip_invalid_event, :bool, default: true

desc "The field name of the client's source address."
config_param :source_address_key, :string, default: nil
Expand Down
8 changes: 1 addition & 7 deletions test/plugin/test_in_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,6 @@ def create_driver(conf=base_config)
end
chunk = ["tag1", entries, { 'compressed' => 'gzip' }].to_msgpack

# check CompressedMessagePackEventStream is created
mock(Fluent::CompressedMessagePackEventStream).new(entries, nil, 0, compress: :gzip)

d.run do
Fluent::MessagePackFactory.msgpack_unpacker.feed_each(chunk) do |obj|
option = d.instance.send(:on_message, obj, chunk.size, DUMMY_SOCK)
Expand All @@ -604,13 +601,10 @@ def create_driver(conf=base_config)
entries = ''
events.each do |_tag, _time, record|
v = [_time, record].to_msgpack
entries << compress(v)
entries << compress(v, type: :zstd)
end
chunk = ["tag1", entries, { 'compressed' => 'zstd' }].to_msgpack

# check CompressedMessagePackEventStream is created
mock(Fluent::CompressedMessagePackEventStream).new(entries, nil, 0, compress: :zstd)

d.run do
Fluent::MessagePackFactory.msgpack_unpacker.feed_each(chunk) do |obj|
option = d.instance.send(:on_message, obj, chunk.size, DUMMY_SOCK)
Expand Down
4 changes: 2 additions & 2 deletions test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ def try_write(chunk)
end

test 'send_compressed_message_pack_stream_if_compress_is_gzip' do
target_input_driver = create_target_input_driver
target_input_driver = create_target_input_driver(conf: target_config + "skip_invalid_event false")

@d = d = create_driver(config + %[
flush_interval 1s
Expand Down Expand Up @@ -571,7 +571,7 @@ def try_write(chunk)
end

test 'send_compressed_message_pack_stream_if_compress_is_zstd' do
target_input_driver = create_target_input_driver
target_input_driver = create_target_input_driver(conf: target_config + "skip_invalid_event false")

@d = d = create_driver(config + %[
flush_interval 1s
Expand Down