[go: up one dir, main page]

Irmin: Correctly reap uname child process in gc_stats

What

This commit fixes a potential resource leak in the GC statistics module by ensuring that the child process spawned to execute the uname command is properly waited for. This prevents the creation of zombie processes.

Why

The previous implementation used Unix.open_process_in to determine the operating system but never called the corresponding Unix.close_process_in. Failing to close the process channel means the parent process does not wait for the child's termination, leaving the child in a "zombie" state. A proliferation of such zombie processes could potentially exhaust system resources, such as entries in the process table.

How

The code has been refactored to explicitly call Unix.close_process_in after reading the output from the uname command. This call blocks until the child process has terminated and its status has been collected, effectively reaping the process. The call is placed to ensure it executes even if reading from the process's standard output fails.

Merge request reports

Loading