geopython/PyWPS — pull request #23 by TobiasKipp (2014-07-09 08:10:18+00:00)
Title: use os.devnull to avoid a deadlock by subprocess.PIPE when

it is not read anyhow.

This issue occurs in combination with a wps process that calls another wps process several times sequentially.
OWSLib is used to run these requests. It makes heavy use of print statements, which results in filling
whatever stdout references too quite fast. It seems that due to not reading subprocess.PIPE
the buffer is full and the process deadlocks at a print statement.

The same test with using os.devnull runs without issues, as there will be no full buffer that blocks.

For subprocess.PIPE 49 wps processes was enough to deadlock, while for os.devnull 1000 sub wps processes ran just fine.

The alternative would be to not set stdout and stderr, but then all messages will be print
on the WPS server.