Skip to content

fix hang in subprocess.Popen / subprocess.wait()#136

Open
fishpepper wants to merge 1 commit intoHewlettPackard:masterfrom
fishpepper:fix_cpplint_wrapper
Open

fix hang in subprocess.Popen / subprocess.wait()#136
fishpepper wants to merge 1 commit intoHewlettPackard:masterfrom
fishpepper:fix_cpplint_wrapper

Conversation

@fishpepper
Copy link

@fishpepper fishpepper commented Dec 20, 2016

I experienced hangs when running the wrapper on projects with huge stylecheck errors.
The python doc (https://docs.python.org/2/library/subprocess.html#subprocess.Popen) has the following snippet concerning calling wait() on the subprocess object:

Warning
This will deadlock when using stdout=PIPE and/or stderr=PIPE and the child process generates enough output to a pipe such that it blocks waiting for the OS pipe buffer to accept more data. Use communicate() to avoid that.

My patch fixes this deadlock by using a temporary file object for storage/data passing


 

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.

1 participant