-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Plugin in_systemd: stalled reads #500
Comments
thanks for reporting the problem and the hints about root cause. I did some tests and effectively there are missing records when breaking the loop (no matter the condition). I've pushed a fix on GIT master, would you please rebuild the latest version and double check the new behavior ? |
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
It still happens, for example with:
|
Signed-off-by: Eduardo Silva <[email protected]>
would you please try the latest from GIT master ?, I did some changes and this time I was not able to reproduce the problem. can you double-check ? |
Now works correctly. |
finally :), thanks for your help. |
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Takahiro Yamashita <[email protected]>
The systemd plugin is stalled reading events.
If you do in one shell:
journalctl -f -o json
and in other:fluent-bit -i systemd -prop=Read_From_Tail=true -p DB=journald.db -p tag='host.*' -o stdout -f 1 -v
and you do for examplesudo su -
you don't see all the events in the fluent-bit output. If you restart the fluent-bit you see the missing events.If you do the same without
-p tag='host.*'
it works.The problem is in:
fluent-bit/plugins/in_systemd/systemd.c
Lines 168 to 169 in 23b6171
When you hit he condition, it's easy to hit the condition of different tags, it will break the loop of
sd_journal_next
andin_systemd_collect
returnsFLB_SYSTEMD_MORE
.The problem is that there is remaining data to read but you will not read it until new data arrives.
When fluent-bit starts it works well because
in_systemd_collect
is called fromin_systemd_collect_archive
and controls the returns codes ofin_systemd_collect
and generates a event when there is more data to read, but the first time thatin_systemd_collect
reached the end of the journalsystemd_collect_archive
registerin_systemd_collect
withflb_input_set_collector_event
andin_systemd_collect_archive
it's not called any more.I hope I have explained the problem.
The text was updated successfully, but these errors were encountered: