[openstack-dev] Should we be using subprocess32?
tony at bakeyournoodle.com
Thu Sep 14 22:18:35 UTC 2017
On Tue, Sep 12, 2017 at 11:29:22AM -0700, Joshua Harlow wrote:
> Hi folks,
> I know there is a bunch of usage of subprocess in openstack and especially
> since there is heavy usage of python 2.7 it made me wonder if we should try
> to move to subprocess32 to avoid some of the bugs that seem to exist (maybe
> distributors backported them?):
> For example a major one (seems to be):
> - https://github.com/google/python-subprocess32/commit/6ef1fea55
> """Popen.wait() is now thread safe so that multiple
> threads may be calling wait() or poll() on a Popen instance at the same
> without losing the Popen.returncode value.
> That one concerns me slightly, because I know that certain openstack
> projects do use threads (and not eventlet monkey-patched green-thread
> TLDR; should we (could we?) switch?
We could. It wouldn't be hard to propose a change to the requirements
repo and that could be used to test what breaks.
As to should we I'm not convinced. It does give us a slightly more
modern subprocess module but it hasn't been updated in nearly 2 years.
I get that it's a backport from 3.3 which isn't getting updated but ...
Also it means adding something like:
if os.name == 'posix' and sys.version_info < 3:
import subprocess32 as subprocess
All over the place which isn't so great.
So overall I'm not certain it's worth it.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: not available
More information about the OpenStack-dev