in_tcp: skip emitting an empty event stream when a read has no complete message
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ruby
- 領域
- backend, performance
調査の方向性
Read the in_tcp input path and compare its handling with the existing <extract> path, which the issue says already avoids emitting for an empty stream. Check the relevant input tests and add or adjust coverage for a read that completes no message. Done means router.emit_stream is skipped for an empty event stream while completed messages still reach the router.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Without <extract>, in_tcp calls router.emit_stream(@tag, es) after every read. It does this even when the read did not complete any message and es is empty. A long message arrives in many reads, so the router, the filters and the output are called many times with an empty stream. The output's emit_count counts these calls too.
With the configuration below, I sent one 1 MiB line in 64 writes of 16 KiB:
ruby -rsocket -e 's = TCPSocket.new("127.0.0.1", 5170); 64.times { s.write("x" * 16384); sleep 0.02 }; s.write("\n"); sleep 1'
monitor_agent then shows:
{"plugin_id":"in_tcp","emit_records":1}
{"plugin_id":"out_null","emit_records":1,"emit_count":66}
<source>
@type monitor_agent
bind 127.0.0.1
port 24220
</source>
<source>
@type tcp
@id in_tcp
tag test
port 5170
bind 127.0.0.1
<parse>
@type none
</parse>
</source>
<match test>
@type null
@id out_null
</match>
Describe the solution you'd like
Call router.emit_stream only when es is not empty. The <extract> code path already emits nothing for such a read.
Describe alternatives you've considered
Keep the current behavior. The empty streams do not create buffer chunks, because Buffer#write_once returns early for empty data. The cost is the extra calls and the larger emit_count.
Additional context
Tested with Fluentd 1.20.1 (master at 1d6b1129) and Ruby 4.0.9 on Linux.
- 主要言語
- Ruby
- スター
- 13.6k
- フォーク
- 1.4k
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 61
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluent/fluentd のほかの issue
-
in_tcp, in_syslog: a non-ASCII delimiter closes the connection with Encoding::CompatibilityErrorオープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
bug enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
fluent/fluentd#5494 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
BufferChunkOverflowError inside @ERROR loops forever - no buffer parameter can stop it再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
fluent/fluentd#5462 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
<system> umask` / `--umask` is not applied to worker-created files under a foreground supervisor再び着手できるかも @mbmtbtbc が 114 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fluent/fluentd#5435 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
Visual COBOL: missing 11.0 and 12.0, and 9.0 date differs from Rocket Software's lifecycle pageオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
endoflife-date/endoflife.date#11561 ·
メンテナーはふだん 1 日以内に返信
-
internal
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Kong/developer.konghq.com#7954 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Fresh comstockpostproc install fails on import: PyAthena 4.x requires SQLAlchemy 2 (AttributeError: sqlalchemy.types has no attribute DOUBLE)対応中かも @JanghyunJK が今日担当しました。 オープンpostprocessing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NatLabRockies/ComStock#473 ·
-
No Ruby in CIオープンarea: core area: devops lane: strong-agent priority: P2 roadmap size: S type: removal type: task
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
arminazimi/slipway#1216 ·
メンテナーはふだん 1 日以内に返信