Skip to content

bpo-27448: Work around a gc.disable race condition in subprocess.#1932

Merged
gpshead merged 2 commits into
python:2.7from
gpshead:issue27448_2.7
Sep 5, 2017
Merged

bpo-27448: Work around a gc.disable race condition in subprocess.#1932
gpshead merged 2 commits into
python:2.7from
gpshead:issue27448_2.7

Conversation

@gpshead
Copy link
Copy Markdown
Member

@gpshead gpshead commented Jun 3, 2017

This works around a gc.isenabled/gc.disable race condition in the 2.7
subprocess module by using a lock for the critical section. It'll
prevent multiple simultaneous subprocess launches from winding up with
gc remaining disabled but it can't fix the ultimate problem: gc enable
and disable is a global setting and a hack.

Users are strongly encouraged to use subprocess32 from PyPI instead
of the 2.7 standard library subprocess module. Mixing threads with
subprocess is a recipie for disaster otherwise even with "fixes" to
ameliorate common issues like this.

https://bugs.python.org/issue27448

Comment thread Lib/subprocess.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe use dummy_threading?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

dummy_threading doesn't give us anything useful. this is fine.

This works around a gc.isenabled/gc.disable race condition in the 2.7
subprocess module by using a lock for the critical section.  It'll
prevent multiple simultaneous subprocess launches from winding up with
gc remaining disabled but it can't fix the ultimate problem: gc enable
and disable is a global setting and a hack.

Users are *strongly encouraged* to use subprocess32 from PyPI instead
of the 2.7 standard library subprocess module.  Mixing threads with
subprocess is a recipie for disaster otherwise even with "fixes" to
ameliorate common issues like this.
@gpshead gpshead merged commit 5e8e371 into python:2.7 Sep 5, 2017
@gpshead gpshead deleted the issue27448_2.7 branch September 5, 2017 18:20
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.

3 participants