[llvm-commits] [zorg] r126095 - /zorg/trunk/llvmlab/llvmlab/ci/status.py

Daniel Dunbar daniel at zuster.org
Sun Feb 20 14:12:08 PST 2011


Author: ddunbar
Date: Sun Feb 20 16:12:08 2011
New Revision: 126095

URL: http://llvm.org/viewvc/llvm-project?rev=126095&view=rev
Log:
llvmlab: Watchdog buildbot monitor, in case we get an unexpected exception
(e.g., on a network outage).

Modified:
    zorg/trunk/llvmlab/llvmlab/ci/status.py

Modified: zorg/trunk/llvmlab/llvmlab/ci/status.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ci/status.py?rev=126095&r1=126094&r2=126095&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ci/status.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ci/status.py Sun Feb 20 16:12:08 2011
@@ -4,6 +4,8 @@
 
 import threading
 import time
+import traceback
+import StringIO
 
 from llvmlab import util
 import buildbot.statusclient
@@ -43,6 +45,24 @@
         self.status = status
 
     def run(self):
+        while 1:
+            try:
+                self.read_events()
+            except:
+                # Log this failure.
+                os = StringIO.StringIO()
+                print >>os, "*** ERROR: failure in buildbot monitor"
+                print >>os, "\n-- Traceback --"
+                traceback.print_exc(file = os)
+                if self.app.logger:
+                    self.app.logger.warning(os.getvalue())
+                else:
+                    print >>sys.stderr, os.getvalue()
+
+                # Sleep for a while, then restart.
+                time.sleep(60)
+
+    def read_events(self):
         # Constantly read events from the status client.
         while 1:
             for event in self.status.statusclient.pull_events():





More information about the llvm-commits mailing list