-
Notifications
You must be signed in to change notification settings - Fork 33
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
deadlock error #69
Comments
Which version of Fluentd and Ruby do you use? |
Hey Okkez! Dockerfile for the images used is here: We use Ruby 2.5.1-slim, concat 2.3.0 & fluentd 1.4.0 in our latest build. Don’t believe we saw this using ruby 2.5.1-slim with fluentd 1.2.x & concat 2.2.2 which we used in the previous version of our images. Thanks for having a look! |
anything further I can help collect to assist with this? |
@matthewmodestino Thanks. |
Have you had the chance to test the plugin against fluent 1.4? What is your preferred testing method? If I provide steps using our docker container, is that ok? Or do you prefer testing some other way? |
I have tested this plugin using very simple configuration and logs with Fluentd 1.4.x. I like bare metal environment for debugging. |
Hi @okkez, Apologies for the delay. I have pushed test configs to my repo, that I hope will make it easy for you to have a look at this. I used docker for mac, but technically these configs should be able to run in any docker enviro. You can clone the repo:
Or just grab the https://github.com/matthewmodestino/container_workshop/tree/master/splunk_docker Once you have pulled down the folders (the following assumes you keep the folder naming), from within the
give the Splunk container a minute or two to start up. This is just to ensure fluentd has a valid backend to send to. From within the
The fluentd folder has the The
You should now have the following 2 containers running:
Now check the logs of the fluentd container:
at the very top of the log we dump the running configs and versions:
and you should see that the logs we picked up from the fluentd container itself start triggering the concat rule and spitting errors:
Let me know if there is something specific you would like me to check in the fluentd container itself. to clean up these resources: from within your
then from within your
Clean up docker volumes:
|
Sorry for the delay. I missed the issue. Try following diff: diff --git a/fluentd_docker/config/output.conf b/fluentd_docker/config/output.conf
index 9029af3..531748f 100644
--- a/fluentd_docker/config/output.conf
+++ b/fluentd_docker/config/output.conf
@@ -1,10 +1,9 @@
-<label @SPLUNK>
- # extract index fields and sourcetype for container logs
+<label @TRANSFORM1>
+ # extract index fields and sourcetype for container logs
<filter tail.containers.**>
@type jq_transformer
jq '.record | .container_id = (.source | capture("(?<container_id>[0-9a-f]{12})") | .container_id)'
</filter>
-
<filter tail.containers.**>
@type concat
key log
@@ -13,14 +12,26 @@
multiline_start_regexp /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/
flush_interval 5s
</filter>
+ <match>
+ @type relabel
+ @label @SPLUNK
+ </match>
+</label>
- # = filters for docker config =
+<label @TRANSFORM2>
+ # = filters for docker config =
<filter tail.config.**>
@type jq_transformer
jq ".record.sourcetype = \"docker:config\" | .record"
</filter>
-
- # = output =
+ <match>
+ @type relabel
+ @label @SPLUNK
+ </match>
+</label>
+
+<label @SPLUNK>
+ # = output =
<match **>
@type splunk_hec
protocol https
diff --git a/fluentd_docker/config/source.containers.conf b/fluentd_docker/config/source.containers.conf
index 636c6ac..af4a05d 100644
--- a/fluentd_docker/config/source.containers.conf
+++ b/fluentd_docker/config/source.containers.conf
@@ -18,7 +18,7 @@
<source>
@id containers.log
@type tail
- @label @SPLUNK
+ @label @TRANSFORM1
tag tail.containers.*
path /var/lib/docker/containers/*/*-json.log
pos_file /var/log/splunk-fluentd-containers.log.pos
diff --git a/fluentd_docker/config/source.docker.conf b/fluentd_docker/config/source.docker.conf
index e1c5246..43f43fe 100644
--- a/fluentd_docker/config/source.docker.conf
+++ b/fluentd_docker/config/source.docker.conf
@@ -2,7 +2,7 @@
<source>
@id config.v2
@type tail
- @label @SPLUNK
+ @label @TRANSFORM2
tag tail.config.*
path /var/lib/docker/containers/*/config.v2.json
pos_file /var/log/splunk-fluentd-docker-config.log.pos In the original configuration, concat plugin configuration includes In the above diff, I set the proper label to apply the appropriate filter per |
Thanks so much for checking. I will review and advise. |
I can also confirm that avoiding reemission to the current label fixes the problem. The use case here is with Docker's If anyone is interested this is my current configuration snippet, working well in
|
@peter-slovak I have a log (size 59k) that gets truncated into four separated log by docker and the partial log (59k) is created with other regular logs. How does the "partial_key log" or "partial_key partial_message" determine when the partial log ends to append the partial logs?
Thanks. |
@bamb00 As I understand it, Docker flags partial logs in its internal structure and then exposes that flag to a particular logging driver/plugin. In case of fluentd, the flag makes it into the Since these logs are line-oriented, as soon as we encounter an |
Problem
If I use multiline detection, it works but I get
deadlock; recursive locking
errors in fluentd logs(concat plugin is used as part of Splunk connect for Kubernetes https://github.com/splunk/splunk-connect-for-kubernetes)
Steps to replicate
Log:
Config:
Expected Behavior
It works (multi line appears as a single event in Splunk) but I see many errors in fluentd logs. I believe 1 error every 5 second for every log file:
Your environment
See original ticket splunk/splunk-connect-for-kubernetes#111
The text was updated successfully, but these errors were encountered: