[CalendarServer-changes] [8396] CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/ spawnsvc.py

source_changes at macosforge.org source_changes at macosforge.org
Sat Dec 3 00:39:52 PST 2011


Revision: 8396
          http://trac.macosforge.org/projects/calendarserver/changeset/8396
Author:   glyph at apple.com
Date:     2011-12-03 00:39:52 -0800 (Sat, 03 Dec 2011)
Log Message:
-----------
more generously log error messages from subprocesses when they occur

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py

Modified: CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py
===================================================================
--- CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py	2011-12-03 08:39:42 UTC (rev 8395)
+++ CalendarServer/branches/users/glyph/parallel-upgrade/twext/internet/spawnsvc.py	2011-12-03 08:39:52 UTC (rev 8396)
@@ -21,6 +21,8 @@
 import os
 import sys
 
+from twisted.python import log
+
 from twisted.python.reflect import namedAny
 from twisted.internet.stdio import StandardIO
 from twisted.internet.error import ReactorNotRunning
@@ -97,7 +99,7 @@
 
 
 
-class BridgeProtocol(ProcessProtocol):
+class BridgeProtocol(ProcessProtocol, object):
     """
     Process protocol implementation that delivers data to the C{hereProto}
     associated with an invocation of L{SpawnerService.spawn}.
@@ -133,8 +135,10 @@
 
     def errReceived(self, data):
         """
-        Some standard error was received from the subprocess. (TODO: logging?)
+        Some standard error was received from the subprocess.
         """
+        log.msg("Error output from process: " + data,
+                isError=True)
 
 
     _killTimeout = None
@@ -203,10 +207,10 @@
             self.pendingSpawns.append((hereProto, thereProto))
             return
         name = qual(thereProto)
+        argv = [sys.executable, '-u', '-m', __name__, name]
         self.reactor.spawnProcess(
             BridgeProtocol(self, hereProto), sys.executable,
-            [sys.executable, '-m', __name__, name], os.environ,
-            childFDs=childFDs
+            argv, os.environ, childFDs=childFDs
         )
         return succeed(hereProto)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20111203/2f402cd7/attachment.html>


More information about the calendarserver-changes mailing list