in_exec: Ensure to sleep for prevending fork bomb #1348

Merged
merged 3 commits into from Dec 16, 2016

Projects

None yet

3 participants

@autopp
autopp commented Dec 5, 2016

Since 0.12.18, in_exec dose not sleep run_interval when command or output parsing failed.
This causes the fork bomb.
This is prevended by moving sleep @run_interval to ensure clause.

(Sorry, the added test case may not be good...)

autopp added some commits Dec 2, 2016
autopp ensure to sleep even if command or parsing fails 0d5b434
autopp add tests for the case of invalid command given
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.
8ec6af0
@tagomoris tagomoris added the v0.12 label Dec 6, 2016
@repeatedly repeatedly was assigned by tagomoris Dec 6, 2016
@tagomoris tagomoris added the bug label Dec 6, 2016
@tagomoris
Member

ping @repeatedly ?

@repeatedly
Member

I'm waiting patch update.

@repeatedly
Member

Ahh, wait. My comment isn't appear...

test/plugin/test_in_exec.rb
+ end
+
+ assert_equal true, d.emits.empty?
+ assert_equal true, File.read(@count_file).length.between?(1, 4)
@autopp
autopp commented Dec 15, 2016

@repeatedly Thanks for your review and advice! I updated the test code.
Is it necessary to rebase commits?

@repeatedly repeatedly merged commit 93b8edb into fluent:v0.12 Dec 16, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@repeatedly
Member

Is it necessary to rebase commits?

Not needed.

Thanks!

@autopp
autopp commented Dec 16, 2016 edited

👍
Thanks you!

@autopp autopp deleted the autopp:ensure_sleep_in_exec branch Dec 16, 2016
@autopp autopp restored the autopp:ensure_sleep_in_exec branch Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment