Workaround twisted 8.x pipe-based waker
authorIustin Pop <iustin@google.com>
Tue, 10 Feb 2009 13:04:55 +0000 (13:04 +0000)
committerIustin Pop <iustin@google.com>
Tue, 10 Feb 2009 13:04:55 +0000 (13:04 +0000)
commite12e3e4c57125289d95c1663372415a1280449fc
tree2a16057c01573f11eca85c26c78fa387102e9058
parent100c90d3af3813f5fe2cbde63ffd7b6e1ea5abdc
Workaround twisted 8.x pipe-based waker

Twisted 8.x uses a waker objects for inter-thread signalling and the on
POSIX platforms the waker uses pipes for communication, which should not
be closed.

For some reasons, sometime the waker deals with its pipes being closed,
while at other times it doesn't. As such, we workaround it by skipping
the waker file descriptors in the utils.Daemonize function. This is
fragile and will break if Twisted changes internals, but it's a simple
workaround for now.

The patch also adds an assert in Daemonize() so that “standard” file
descriptors (0, 1, 2) are not marked to be kept open.

Reviewed-by: imsnah
daemons/ganeti-noded
lib/utils.py