From 711669763ab997787207d3560be2fef64096457e Mon Sep 17 00:00:00 2001 From: Akanksha Trehun Date: Fri, 17 Jul 2026 17:07:15 +0530 Subject: [PATCH] fix(child_process): fix inverted break condition in close method In the close method's wait-for-exit loop, the condition 'break if living_process_exist' was inverted. It should be 'break unless living_process_exist'. The current code breaks out of the loop as soon as it finds living processes, skipping the wait for them to actually terminate. This allows child processes to become orphaned or zombie processes during shutdown, leaking resources held by those processes. The shutdown method at line 142 correctly implements this pattern: 'if process_exists: sleep; else: break'. Signed-off-by: Akanksha Trehun --- lib/fluent/plugin_helper/child_process.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin_helper/child_process.rb b/lib/fluent/plugin_helper/child_process.rb index e72cb18547..738b336328 100644 --- a/lib/fluent/plugin_helper/child_process.rb +++ b/lib/fluent/plugin_helper/child_process.rb @@ -191,7 +191,7 @@ def close child_process_kill(process_info, force: true) end - break if living_process_exist + break unless living_process_exist sleep CHILD_PROCESS_LOOP_CHECK_INTERVAL end