Skip to contentSkip to conversation

Fix closing of /var/log/xend.log fd

PATCH In review Jeremy Katz 2 participants 2 messages Sep 1, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix closing of /var/log/xend.log fd

The attached patch fixes the problem where /var/log/xend.log was getting closed and then /var/log/xend-debug was getting all the spam about the fd being closed in the logging stuff.

Basically what was happening is that the main thread wasn't sticking around and during its exit, the atexit handlers of the python logging stuff got called closing the log fd.

Patch makes it so that we instead wait on the real server threads to exit before shutting things down.

Jeremy

tools/python/xen/xend/server/SrvServer.py +5 -0
diff -r 8af8ddf91078 tools/python/xen/xend/server/SrvServer.py
@@ -61,9 +61,14 @@
 
     def start(self):
         Vifctl.network('start')
+        threads = []
         for server in self.servers:
             thread = Thread(target=server.run)
             thread.start()
+            threads.append(thread)
+
+        for t in threads:
+            t.join()
 
 def create():
     root = SrvDir()

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Thanks!

Quoted 24 lines · Jeremy Katz

The attached patch fixes the problem where /var/log/xend.log was getting closed and then /var/log/xend-debug was getting all the spam about the fd being closed in the logging stuff.

Basically what was happening is that the main thread wasn't sticking around and during its exit, the atexit handlers of the python logging stuff got called closing the log fd.

Patch makes it so that we instead wait on the real server threads to exit before shutting things down.

Jeremy

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel