filter_multiline: synchronize buffered output-processor appends with the flush timer
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with plugins/filter_multiline/ml.c and trace cb_ml_filter(), get_or_create_stream(), flush_callback(), and shutdown alongside the multiline core append and auto-flush paths. Then inspect output worker dispatch in flb_output.c and flb_output.h, and the runtime tests named in the issue. Done means real multi-worker dispatch and timer flushes are covered, records flush correctly, shutdown is safe, classic-filter and input-processor tests pass, and ThreadSanitizer reports no races.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Track the pre-existing synchronization problem when buffered multiline parser mode runs as an output processor.
As identified in the discussion on PR #12678, output processors execute from output flush helpers on worker threads, while cb_ml_init() initializes the multiline auto-flush timer on the main scheduler. The worker path and timer can therefore access the same multiline state concurrently.
get_or_create_stream() mutates ctx->ml_streams, and flb_ml_append_event() mutates parser group buffers. The timer flush path reads or modifies that state and invokes flush_callback(), which looks up stream metadata through get_by_id().
This can cause data races and inconsistent stream or parser state. This issue tracks the synchronization concern; no runtime crash reproduction is claimed here.
Scope and required changes
- Establish safe ownership or synchronization for buffered multiline parser state when used as an output processor.
- Serialize stream creation, lookup, list mutation, and parser appends with timer-driven flushes. Account for concurrent output workers sharing the processor context.
- Review flush callbacks, emitter interactions, and shutdown/destruction under the same ownership model. Avoid deadlocks or callback re-entry problems.
- Document the threading contract and preserve existing classic-filter and input-processor behavior.
- Add regression coverage that exercises real output worker dispatch concurrently with timer flushes.
Possible approaches include a shared synchronization mechanism or confining parser operations and timer flushes to one owner thread. The implementation should select and document the appropriate approach.
Affected areas
plugins/filter_multiline/ml.c:cb_ml_init(),cb_ml_filter(),get_or_create_stream(),get_by_id(),flush_callback(), and shutdown/destruction.- Multiline core auto-flush and append paths.
- Output processor initialization and output flush helpers (
flb_output.candflb_output.h). tests/runtime/filter_multiline.cand appropriate output-processor runtime coverage.
Acceptance criteria
- Output-worker appends and timer flushes cannot access shared stream lists or parser buffers without synchronization or single-thread ownership.
- Tests exercise actual output worker dispatch, including multiple workers, while timer flushes occur. Do not use a formatter test hook that bypasses worker dispatch.
- Tests verify correct multiline concatenation and pending-content flushing without missing or duplicate records.
- A ThreadSanitizer run of the concurrency regression reports no races in the affected multiline state.
- Shutdown completes without deadlocks or invalid memory access.
- Classic-filter and input-processor multiline tests continue to pass.
Relationship to PR #12678
This is separate from idle-stream eviction. PR #12678 disables idle eviction for output processors to avoid adding stream frees to the existing race. Disabling eviction does not serialize existing appends and timer flushes. Keep that safeguard until output-processor stream lifecycle safety is established; enabling eviction is not required by this issue.
Requested by @baizhenyu.
- PR: https://github.com/fluent/fluent-bit/pull/12678
- Follow-up request and discussion: https://github.com/fluent/fluent-bit/pull/12678#discussion_r4404183221
- Earlier review discussion: https://github.com/fluent/fluent-bit/pull/12678#discussion_r4404123548
- Lingua principale
- C
- Stelle
- 8.2k
- Fork
- 2k
- Merge medio
- 3g 20h
- PR unite (30g)
- 99
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un 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/fluent-bit
-
in_tail: files falsely detected as rotated on macOS with threaded inputs, causing duplicate recordsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fluent/fluent-bit#12780 ·
I maintainer di solito rispondono entro 1 giorno
-
status: waiting-for-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fluent/fluent-bit#12683 · 2 commenti · 6 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fluent/fluent-bit#12657 ·
I maintainer di solito rispondono entro 1 giorno
-
http: Transfer-Encoding chunked plus Content-Length hangs forever (CL branch shadows the chunked path)Forse già presa @sarankumar1325 l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
fluent/fluent-bit#12656 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
fluent/fluent-bit#12649 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di fluent/fluent-bit
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
micropython/micropython#19942 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 3 giorni
-
快速入门那里会不会对新手不太友好,提出优化方案Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
-
-disable-symbolserver is ignored on macOS/Linux: PDBs are still downloaded from msdl.microsoft.comAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100