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 leaking processes from TypeInferenceProvider #474

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

lisroach
Copy link
Contributor

@lisroach lisroach commented Apr 1, 2021

Summary

#472

Switches to use subprocess.run instead of Popen.communicate which will automatically kill child process for us. Also removed the usage of shell=True because it is unnecessary and can be a security concern.

Test Plan

Updated existing unit tests.

Tested manually (with python3 -Wdefault test_libcst.py as referenced in #472) to ensure the ResourceWarning went away and Zombie processes are not spawned.

tox -e py37

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 1, 2021
@zsol
Copy link
Member

zsol commented Apr 2, 2021

Something's wrong with they pyre integration, you can manually check with python libcst/tests/test_pyre_integration.py in a venv that has pyre setup.

Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@zsol zsol changed the title Switches to subprocess.run(). Fix leaking processes from TypeInferenceProvider Apr 2, 2021
@zsol zsol merged commit e759ca8 into Instagram:master Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants