Ver código fonte

Deal with failure at startup on Debian Sarge (options.mktempfile failed
with bad file descriptor error). See http://www.plope.com/software/collector/252

Chris McDonough 17 anos atrás
pai
commit
be39d743b8
2 arquivos alterados com 12 adições e 0 exclusões
  1. 8 0
      CHANGES.txt
  2. 4 0
      src/supervisor/options.py

+ 8 - 0
CHANGES.txt

@@ -2,6 +2,14 @@ Next Release
 
   - 3.0a3 broke Python 2.3 backwards compatibility.
 
+  - On Debian Sarge, one user reported that a call to
+    options.mktempfile would fail with an "[Errno 9] Bad file
+    descriptor" at supervisord startup time.  I was unable to
+    reproduce this, but we found a workaround that seemed to work for
+    him and it's included in this release.  See
+    http://www.plope.com/software/collector/252 for more information.
+    Thanks to William Dode.
+
 3.0a3
 
   - Supervisorctl now reports a better error message when the main

+ 4 - 0
src/supervisor/options.py

@@ -1120,6 +1120,10 @@ class ServerOptions(Options):
         return os.execve(filename, argv, env)
 
     def mktempfile(self, suffix, prefix, dir):
+        # set os._urandomfd as a hack around bad file descriptor bug
+        # seen in the wild, see
+        # http://www.plope.com/software/collector/252
+        os._urandomfd = None 
         fd, filename = tempfile.mkstemp(suffix, prefix, dir)
         os.close(fd)
         return filename