Boost logo

Boost-Commit :

From: troy_at_[hidden]
Date: 2008-06-04 07:56:03


Author: troy
Date: 2008-06-04 07:56:03 EDT (Wed, 04 Jun 2008)
New Revision: 46111
URL: http://svn.boost.org/trac/boost/changeset/46111

Log:
Timeout subprocesses, allow xmlrpc transmission of 'none' values
Text files modified:
   branches/CMake/release/tools/build/CMake/boost_build_slave.py.in | 2 ++
   branches/CMake/release/tools/build/CMake/marshal.py.in | 25 +++++++++++++++++++++----
   branches/CMake/release/tools/build/CMake/post.py.in | 2 +-
   3 files changed, 24 insertions(+), 5 deletions(-)

Modified: branches/CMake/release/tools/build/CMake/boost_build_slave.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/boost_build_slave.py.in (original)
+++ branches/CMake/release/tools/build/CMake/boost_build_slave.py.in 2008-06-04 07:56:03 EDT (Wed, 04 Jun 2008)
@@ -21,6 +21,8 @@
 uname = os.uname()
 toolset = "@BOOST_TOOLSET@"
 
+timeout_seconds = 30
+
 xmlrpc_url = "@BOOST_BUILD_SLAVE_SUBMIT_URL@"
 
 build_id_file = os.path.join("@BOOST_BUILD_SLAVE_PYTHONPATH@", "build_id.txt")

Modified: branches/CMake/release/tools/build/CMake/marshal.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/marshal.py.in (original)
+++ branches/CMake/release/tools/build/CMake/marshal.py.in 2008-06-04 07:56:03 EDT (Wed, 04 Jun 2008)
@@ -11,9 +11,12 @@
 # (used to mark up the output) and executes compiler in a subshell, checking
 # for errors and marshalling output to disk.
 #
-import sys, os.path, marshal
+import sys
+sys.path.append("@BOOST_BUILD_SLAVE_PYTHONPATH@")
+from boost_build_slave import *
+
+import datetime, time, signal
 from subprocess import Popen, PIPE
-import xml.etree.ElementTree as ET
 
 log = os.path.join(sys.argv[1], "Log.marshal")
 op = sys.argv[2]
@@ -24,14 +27,28 @@
 print "***\n*** Executing op:" + op + "\n*** " + str(argv) + "\n*** log=" + log + "\n***"
 
 #
-# execute subprocess
+# execute subprocess, watch for timeout
 #
 subproc = None
 returncode = None
 ex = None
 try:
+ start = datetime.datetime.now()
     subproc = Popen(argv, stdout=PIPE, stderr=PIPE)
- returncode = subproc.wait()
+ returncode = subproc.poll()
+ while returncode is None:
+ time.sleep(1)
+ now = datetime.datetime.now()
+ if (now - start).seconds > timeout_seconds:
+ os.kill(subproc.pid, signal.SIGKILL)
+ os.waitpid(-1, os.WNOHANG)
+ e = OSError()
+ e.errno = 666
+ e.message = e.strerror = "TIMEOUT AFTER %d SECONDS" % timeout_seconds
+ e.filename = argv[0]
+ raise e
+ returncode = subproc.poll()
+
 except EnvironmentError, e:
     ex = e
 

Modified: branches/CMake/release/tools/build/CMake/post.py.in
==============================================================================
--- branches/CMake/release/tools/build/CMake/post.py.in (original)
+++ branches/CMake/release/tools/build/CMake/post.py.in 2008-06-04 07:56:03 EDT (Wed, 04 Jun 2008)
@@ -15,7 +15,7 @@
 sys.path.append("@BOOST_BUILD_SLAVE_PYTHONPATH@")
 from boost_build_slave import *
 
-s = xmlrpclib.Server(xmlrpc_url)
+s = xmlrpclib.Server(xmlrpc_url, allow_none=True)
 
 project_name = sys.argv[1]
 parent_target = sys.argv[2]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk