rickmcgeer / TransCloud

Software for the TransCloud project
5 stars 1 forks source link

fix all uses of popen3 to use communicate #63

Open cmatthew opened 11 years ago

cmatthew commented 11 years ago

popen3 calls need to not call wait, but rather communicate and check if finished.

This will cause blocking and bugs.

Places where this is manifesting are in ogrinfo and swift list.

All uses of the popen should be checked though!!

rickmcgeer commented 11 years ago

Fixed. According to the Python documentation, communicate() only completes when the files are closed, so no check on finished is required.

cmatthew commented 11 years ago

Then, does that fix our issue with large outputs?

On 2013-03-13, at 11:43 AM, rickmcgeer notifications@github.com wrote:

Fixed. According to the Python documentation, communicate() only completes when the files are closed, so no check on finished is required.

— Reply to this email directly or view it on GitHub.

cmatthew commented 11 years ago

I propose a unit test for this. We can to catch long running and large output programs. Perhaps a simple test is to just make a python program like this:

import time
time.sleep(10)
print "0"*10000000

which should print 10MB of text and run for at least 10 seconds. If we capture the output correctly and block correcltly we know it is working.