[copr] skvidal-backend: more logging in error conditions having to do with spawning instances (31ab388)

skvidal at fedorahosted.org skvidal at fedorahosted.org
Tue Dec 4 21:39:49 UTC 2012


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : skvidal-backend

>---------------------------------------------------------------

commit 31ab388e827dbe9a279a8bb8eac76ff1acb60212
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Dec 4 16:37:43 2012 -0500

    more logging in error conditions having to do with spawning instances


>---------------------------------------------------------------

 backend/dispatcher.py |    9 ++++++++-
 copr-be.py            |    1 +
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 225b75d..bf80e28 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -99,7 +99,10 @@ class Worker(multiprocessing.Process):
             self.logfile = self.opts.worker_logdir + '/worker-%s.log' % self.worker_num
             self.callback = WorkerCallback(logfile = self.logfile)
         
-        self.callback.log('creating worker: %s' % ip)
+        if ip:
+            self.callback.log('creating worker: %s' % ip)
+        else:
+            self.callback.log('creating worker: with dynamic ip')
 
     def spawn_instance(self):
         """call the spawn playbook to startup/provision a building instance"""
@@ -123,6 +126,10 @@ class Worker(multiprocessing.Process):
             if i =='localhost':
                 continue
             return i
+        
+        # if we get here we're in trouble
+        self.callback.log('No IP back from spawn_instance - dumping cache output')
+        self.callback.log(str(play.SETUP_CACHE))
         return None
 
     def terminate_instance(self,ip):
diff --git a/copr-be.py b/copr-be.py
index 2cc0fba..73ab70a 100644
--- a/copr-be.py
+++ b/copr-be.py
@@ -117,6 +117,7 @@ class CoprBackend(object):
                 #       #insert a poison pill? Kill after something? I dunno.
                 # FIXME - if a worker bombs out - we need to check them
                 # and startup a new one if it happens
+            # check for dead workers and abort
             for w in self.workers:
                 if not w.is_alive():
                     raise errors.CoprBackendError, "Worker died unexpectedly"



More information about the copr-devel mailing list