extras-buildsys/server ArchJob.py, 1.23, 1.24 PackageJob.py, 1.40, 1.41

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Thu Feb 16 06:21:30 UTC 2006


Author: dcbw

Update of /cvs/fedora/extras-buildsys/server
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12874/server

Modified Files:
	ArchJob.py PackageJob.py 
Log Message:
2006-02-16  Dan Williams  <dcbw at redhat.com>

    * server/ArchJob.py
        - (process): don't trap AttributeErrors triggered by running the status
            worker function, only trap them when getting the status worker
            function.  Also don't set state to 'failed' when an internal error
            occurs, since that's not a valid status.
        - (internal_failure): new function

    * server/PackageJob.py
        - (_stage_building): trap and report internal failures too




Index: ArchJob.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/ArchJob.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ArchJob.py	12 Jan 2006 21:39:08 -0000	1.23
+++ ArchJob.py	16 Feb 2006 06:21:23 -0000	1.24
@@ -48,6 +48,7 @@
         self._builder_status = ''
         self._failure_noticed = False
         self._download_failed = False
+        self._internal_failure = False
         self._target_dict = target_dict
         self._builder_gone = False
         self._download_lock = threading.Lock()
@@ -87,6 +88,9 @@
     def download_failed(self):
         return self._download_failed
 
+    def internal_failure(self):
+        return self._internal_failure
+
     def prepping(self):
         return self._prepping
 
@@ -306,12 +310,18 @@
                         self._target_dict['arch'], self.jobid)
             return
 
+        status_func = None
         try:
-            func = getattr(self, "_status_%s" % self._status)
-            func()
+            status_func = getattr(self, "_status_%s" % self._status)
         except AttributeError:
-            print "ERROR: internal archjob inconsistency, didn't recognize status '%s'.\n" % self._status
-            self._set_status('failed')
+            print "%s (%s/%s): %s - internal archjob inconsistency.  Unknown status '%s'." % (self.par_job.uid, self.par_job.package,
+                        self._target_dict['arch'], self.jobid, self._status)
+            self._set_status('done')
+            self._internal_failure = True
+            return
+            
+        # Do the actual work for this status
+        status_func()
 
     def get_status(self):
         return self._status


Index: PackageJob.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/server/PackageJob.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- PackageJob.py	1 Dec 2005 03:17:26 -0000	1.40
+++ PackageJob.py	16 Feb 2006 06:21:23 -0000	1.41
@@ -760,7 +760,7 @@
             if job.get_status() is 'done':
                 completed_jobs = completed_jobs + 1
 
-                if job.builder_failed() or job.download_failed():
+                if job.builder_failed() or job.download_failed() or job.internal_failure():
                     failed_jobs = failed_jobs + 1
 
                     # Normal jobs will just stop when a single archjob fails, but
@@ -776,6 +776,9 @@
                         elif job.download_failed():
                             msg = "Job failed on arch %s: couldn't download result files from builder '%s'.\n " \
                             "Please contact the build system administrator." % (jobarch, job.builder.address())
+                        elif job.internal_failure():
+                            msg = "Job failed on arch %s: there was an internal build system failure.\n " \
+                            "Please contact the build system administrator." % jobarch
                         self._archjobs_lock.release()
                         raise BuildError(msg, jobarch)
 




More information about the scm-commits mailing list