Skip to content

Commit 7116697

Browse files
committed
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 <akankshatrehun@gmail.com>
1 parent f380d99 commit 7116697

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/fluent/plugin_helper/child_process.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def close
191191
child_process_kill(process_info, force: true)
192192
end
193193

194-
break if living_process_exist
194+
break unless living_process_exist
195195

196196
sleep CHILD_PROCESS_LOOP_CHECK_INTERVAL
197197
end

0 commit comments

Comments
 (0)