salt icon indicating copy to clipboard operation
salt copied to clipboard

[BUG] minion using multiprocessing will leek pipe fd

Open liangyihong opened this issue 1 year ago • 4 comments

Description While minion config multiprocessing is True, parent process will leek fd, because multiprocessing using popen. In class SubprocessList , it's function cleanup need to add proc.join() if using multiprocessing , to clean parent process fd(pipe).

liangyihong avatar Jul 17 '24 09:07 liangyihong

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!

welcome[bot] avatar Jul 17 '24 09:07 welcome[bot]

@liangyihong I see join getting called here: https://github.com/saltstack/salt/blob/3006.x/salt/utils/process.py#L1175

dwoz avatar Jul 22 '24 21:07 dwoz

@liangyihong I see join getting called here: https://github.com/saltstack/salt/blob/3006.x/salt/utils/process.py#L1175

@dwoz Sorry, that was a typo. It need to add proc.close() to clean parent process fd(pipe).In python3, package multiprocessing/popen_fork.py, the class Popen need call close() to clean parent pipe fd.

liangyihong avatar Jul 23 '24 07:07 liangyihong

@liangyihong I see join getting called here: https://github.com/saltstack/salt/blob/3006.x/salt/utils/process.py#L1175

@dwoz Sorry, that was a typo. It need to add proc.close() to clean parent process fd(pipe).In python3, package multiprocessing/popen_fork.py, the class Popen need call close() to clean parent pipe fd.

Makes sense, thanks.

dwoz avatar Jul 30 '24 01:07 dwoz

Fixed by #66778

twangboy avatar Jun 30 '25 21:06 twangboy