-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Fluent::Plugin::Base#after_start to detect end of #start #1190
Conversation
This is to make a detection that #start method completely finished. Without this method, flush/enqueue threads will run without consideration even if Output#start takes long time to finish. Output#start may need long time to finish if it tries network connection or service detection over internet.
@repeatedly Please check this change. This should be included in next release. |
@@ -922,6 +927,11 @@ def enqueue_thread_run | |||
interval = @buffer_config.flush_thread_interval | |||
end | |||
|
|||
while !self.after_started? && !self.stopped? | |||
sleep interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is actual interval
value needed for this check?
sleep 1
is not good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sleep 1
works well... right, longer interval is not good. I'll update code.
It's green on CI. I'll merge this later. |
Does this addition require plugins to call I was testing things using Fluentd v0.14.12 and the Elasticsearch output plugin v1.9.2 (which extends from As a result, this would eventually lead to a def start
super
self.after_start
end |
No. elasitcsearch plugin v1.9.2 uses v0.12 API and v0.14 uses compat layer for it. |
This method (and flag which shows this method is called properly) helps threads to start its actual process when all preparations are done.
This fixes #1187.