[tahoe-lafs-trac-stream] [tahoe-lafs] #1274: eliminate pywin32 dependency
tahoe-lafs
trac at tahoe-lafs.org
Thu Jan 20 20:54:44 UTC 2011
#1274: eliminate pywin32 dependency
------------------------------+---------------------------------------------
Reporter: davidsarah | Owner: warner
Type: defect | Status: new
Priority: major | Milestone: 1.8.2
Component: code-storage | Version: 1.8.0
Resolution: | Keywords: pywin32 windows win64 docs-needed news-needed
Launchpad Bug: |
------------------------------+---------------------------------------------
Comment (by davidsarah):
Replying to [comment:20 warner]:
> Replying to [comment:14 davidsarah]:
> >
> > * change {{{test_runner.py}}} and {{{iputil.py}}} to use the
> > {{{subprocess}}} module.
>
> The usual problem with using {{{subprocess}}} is {{{SIGCHLD}}}:
Twisted's
> reactor and {{{subprocess.py}}} fight over who gets to register a
handler.
> The reactor isn't strictly running during a {{{trial}}} unit test
context. It
> sort of is, but {{{reactor.run()}}} isn't called, and I've had problems
using
> {{{reactor.spawnProcess}}} or {{{utils.getProcessOutputAndValue}}} from
tests
> (the "potential zombie child" warning), which I've addressed by
explicitly
> invoking the twisted call that installs its SIGCHLD handler.
>
> But it almost certainly is running when {{{iputil.py}}} gets used. So if
> {{{subprocess.py}}} takes over the SIGCHLD handler, we need to look
carefully
> and make sure that Twisted gets it back again afterwards. I don't know
if we
> use {{{getProcessOutputAndValue}}} anywhere outside of {{{iputil.py}}},
so a
> problem there may not bite us until we add a call like that later (like
maybe
> a call to {{{du -s}}} to measure storage usage), and I'd like to avoid
that
> uncertainty.
With this patch, we no longer use anything that calls
{{{reactor.spawnProcess}}} (either in test or non-test code). Does that
resolve the problem?
{{{iputil.py}}} is the only place where we previously used
{{{getProcessOutput}}} and now uses {{{subprocess.Popen}}}. Note that it
is done in a {{{deferToThread}}} (I'm not sure whether that helps, since
the SIGCHLD handler is process-global).
--
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1274#comment:21>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list