Skip to content

gh-151179: Fix pidfd leak in asyncio _PidfdChildWatcher#151186

Open
deadlovelll wants to merge 2 commits into
python:mainfrom
deadlovelll:gh-151179-pidfd-leak
Open

gh-151179: Fix pidfd leak in asyncio _PidfdChildWatcher#151186
deadlovelll wants to merge 2 commits into
python:mainfrom
deadlovelll:gh-151179-pidfd-leak

Conversation

@deadlovelll

Copy link
Copy Markdown
Contributor

_PidfdChildWatcher._do_wait() left os.close(pidfd) outside the cleanup path. The pidfd leaked when waitpid() raising anything other than ChildProcessError. Moving os.close() into a finally block closes the descriptor while still letting the exception propagate.

For more details see gh-151179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant