in_tcp: skip emitting an empty event stream when a read has no complete message
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- ruby
- Ambito
- backend, performance
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Ruby
- Stelle
- 13.6k
- Fork
- 1.4k
- Merge medio
- 1g 1h
- PR unite (30g)
- 61
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fluent/fluentd
-
in_tcp, in_syslog: a non-ASCII delimiter closes the connection with Encoding::CompatibilityErrorApertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
bug enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
fluent/fluentd#5494 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
BufferChunkOverflowError inside @ERROR loops forever - no buffer parameter can stop itForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
fluent/fluentd#5462 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
<system> umask` / `--umask` is not applied to worker-created files under a foreground supervisorForse di nuovo libera @mbmtbtbc l’ha presa 114 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
fluent/fluentd#5435 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fluent/fluentd
Issue simili
-
Visual COBOL: missing 11.0 and 12.0, and 9.0 date differs from Rocket Software's lifecycle pageAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
endoflife-date/endoflife.date#11561 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Fresh comstockpostproc install fails on import: PyAthena 4.x requires SQLAlchemy 2 (AttributeError: sqlalchemy.types has no attribute DOUBLE)Forse già presa @JanghyunJK l’ha presa oggi. Apertapostprocessing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NatLabRockies/ComStock#473 ·
-
bug javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
yegor256/netbout.rb#69 ·