Skip to content

Commit

Permalink
child_process: Plug file descriptor leak
Browse files Browse the repository at this point in the history
Pipes for child processes aren't closed explicitly after exiting child
processes.

Fix #3627

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Aug 9, 2022
1 parent 0ee8322 commit e9a9294
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/fluent/plugin_helper/child_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ def child_process_execute_once(
if cb
cb.call(process_info.exit_status) rescue nil
end
process_info.readio&.close
process_info.writeio&.close
process_info.stderrio&.close
end
thread[:_fluentd_plugin_helper_child_process_running] = true
thread[:_fluentd_plugin_helper_child_process_pid] = pid
Expand Down

0 comments on commit e9a9294

Please sign in to comment.