-
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
in_exec: Ensure to sleep for prevending fork bomb #1348
Conversation
For testing, add new mode to exec_script.rb. In this mode, exec_script.rb output a charactor to stderr and then output a invalid json string to stdout. The test case checks that the total length of command's stderr (this means the count of command execution) is appropriate.
ping @repeatedly ? |
I'm waiting patch update. |
Ahh, wait. My comment isn't appear... |
end | ||
|
||
assert_equal true, d.emits.empty? | ||
assert_equal true, File.read(@count_file).length.between?(1, 4) |
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.
For counting command execution, checking log lines seems enough like below:
fluentd/test/plugin/test_in_forward.rb
Line 167 in e307297
assert_equal 2, logs.count { |line| line =~ /got invalid event and drop it/ } |
@repeatedly Thanks for your review and advice! I updated the test code. |
Not needed. Thanks! |
👍 |
Since 0.12.18,
in_exec
dose not sleeprun_interval
when command or output parsing failed.This causes the fork bomb.
This is prevended by moving
sleep @run_interval
toensure
clause.(Sorry, the added test case may not be good...)