[Pkg-ganeti-commits] r72 - in trunk/ganeti/debian: . patches

iustin-guest at alioth.debian.org iustin-guest at alioth.debian.org
Tue Feb 10 19:10:30 UTC 2009


Author: iustin-guest
Date: 2009-02-10 19:10:30 +0000 (Tue, 10 Feb 2009)
New Revision: 72

Added:
   trunk/ganeti/debian/patches/00-fix-twisted-waker-fds.patch
Modified:
   trunk/ganeti/debian/changelog
Log:
Cherry-pick upstream patch for fixing twisted issues

And also make the 1.2.6-3 release.


Modified: trunk/ganeti/debian/changelog
===================================================================
--- trunk/ganeti/debian/changelog	2009-01-12 07:39:46 UTC (rev 71)
+++ trunk/ganeti/debian/changelog	2009-02-10 19:10:30 UTC (rev 72)
@@ -1,3 +1,11 @@
+ganeti (1.2.6-3) unstable; urgency=low
+
+  * Cherry-pick commit 2461 from upstream, fixing (yet again, hopefully 
+    for the last time) compatibility with twisted 8.1 (Closes: #510965)
+  * Fix the watch regexp to ignore non-stable releases
+
+ -- Iustin Pop <iusty at k1024.org>  Tue, 10 Feb 2009 20:02:46 +0100
+
 ganeti (1.2.6-2) unstable; urgency=low
 
   * Update recommends for the current packages in unstable and

Added: trunk/ganeti/debian/patches/00-fix-twisted-waker-fds.patch
===================================================================
--- trunk/ganeti/debian/patches/00-fix-twisted-waker-fds.patch	                        (rev 0)
+++ trunk/ganeti/debian/patches/00-fix-twisted-waker-fds.patch	2009-02-10 19:10:30 UTC (rev 72)
@@ -0,0 +1,56 @@
+commit 2bdcf7290c87ff18eb4f5ce3955bc0a610a9e3c8
+Author: Iustin Pop <iustinp at gmail.com>
+Date:   Tue Feb 10 13:04:55 2009 +0000
+
+    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
+    
+    git-svn-id: https://ganeti.googlecode.com/svn/branches/ganeti/ganeti-1.2@2461 a6b21a0d-9e31-0410-a73f-d369b950c04d
+
+diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded
+index 58c3804..892db24 100755
+--- a/daemons/ganeti-noded
++++ b/daemons/ganeti-noded
+@@ -618,8 +618,15 @@ def main():
+       sys.exit(5)
+ 
+   # become a daemon
++  noclose_fds = []
++  if hasattr(reactor, 'waker'):
++    # twisted with waker object which has extra fds in use
++    for attr in ('i', 'o'):
++      val = getattr(reactor.waker, attr, None)
++      if isinstance(val, int):
++        noclose_fds.append(val)
+   if options.fork:
+-    utils.Daemonize(logfile=constants.LOG_NODESERVER)
++    utils.Daemonize(logfile=constants.LOG_NODESERVER, noclose_fds=noclose_fds)
+ 
+   logger.SetupLogging(twisted_workaround=True, debug=options.debug,
+                       program="ganeti-noded")
+diff --git a/lib/utils.py b/lib/utils.py
+index 083fd2d..f6c00ee 100644
+--- a/lib/utils.py
++++ b/lib/utils.py
+@@ -1160,6 +1160,7 @@ def Daemonize(logfile, noclose_fds=None):
+   # Iterate through and close all file descriptors.
+   for fd in range(0, maxfd):
+     if noclose_fds and fd in noclose_fds:
++      assert fd > 2, "Cannot keep open standard fd %d" % fd
+       continue
+     try:
+       os.close(fd)




More information about the Pkg-ganeti-commits mailing list