in_tcp: skip emitting an empty event stream when a read has no complete message
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- ruby
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Ruby
- Star
- 13.6k
- Fork
- 1.4k
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 61
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluent/fluentd
-
in_tcp, in_syslog: a non-ASCII delimiter closes the connection with Encoding::CompatibilityErrorCó thể đã có người làm @1AbdullahButt đã nhận 1 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fluent/fluentd#5494 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BufferChunkOverflowError inside @ERROR loops forever - no buffer parameter can stop itCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
fluent/fluentd#5462 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
<system> umask` / `--umask` is not applied to worker-created files under a foreground supervisorCó thể làm lại được @mbmtbtbc đã nhận 115 ngày trước và không có pull request nào đang mở. Đang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
fluent/fluentd#5435 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fluent/fluentd
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openhab/openhab-jruby#571 ·
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
chatwoot/chatwoot#16591 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Tags Listing Shows Paging CountĐang mởgood first issue User Interface
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
rubyforgood/skillrx#740 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
rubys/roundhouse#1917 ·
-
Store credit application selects a payment method from another storeCó thể đã có người làm @beobungbu đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày