Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subprocess I/O descriptor leakage #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

duynhaaa
Copy link

@duynhaaa duynhaaa commented Oct 10, 2022

Because subprocess.Popen is used instead of subprocess.run, the stdout and stderr streams (bound to the subprocess.Popen through subprocess.PIPE) must be closed manually. Without doing so, the I/O descriptors held by them will not be released properly, causing the leakage.

Update: I encountered this problem while running a custom script for a long time (at least 3-4 days).

@duynhaaa duynhaaa marked this pull request as ready for review October 11, 2022 02:14
@savon-noir
Copy link
Owner

are you sure you pushed the right commit ? i don't see any fix for io descriptor in process.py

@duynhaaa
Copy link
Author

are you sure you pushed the right commit ? i don't see any fix for io descriptor in process.py

You are right that I did push the wrong commit! Let me fix it real quick.

@duynhaaa
Copy link
Author

I just pushed the correct commit this time. Please review and let me know if there's anything else that needs to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants