From 67dfff1a343a5337b831eaa9dc55c0b8908b7fb8 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 8 Mar 2016 12:28:54 +0000 Subject: Add debug code for build-graph failures Change-Id: I72977b36a03b11120a2230a48e86fce356f7e3b2 --- gear/client.py | 10 +++++++--- gear/worker.py | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gear/client.py b/gear/client.py index e9d818a6..63067f2d 100644 --- a/gear/client.py +++ b/gear/client.py @@ -28,9 +28,12 @@ class theController(): self.artifact = None self.build_started = False - def _process_build_graph(self, packet): + def _process_build_graph(self, build_graph): + print "=====" + print build_graph + print "=====" print "Decoding artifact received" - self.artifact = distbuild.decode_artifact_reference(job.data[-1]) + self.artifact = distbuild.decode_artifact_reference(build_graph) print "Decoding artifact received done" # Mark everything as unbuilt to begin with. We'll query the actua # state from the cache in self._query_cache_state(). @@ -76,6 +79,7 @@ class theController(): ''' def is_ready_to_build(artifact): + # Just in case the state is not set yet. try: is_ready = (artifact.state == UNBUILT and all(a.state == BUILT @@ -160,7 +164,7 @@ class BuildGraphClient(gear.Client): def handleWorkComplete(self, packet): job = super(BuildGraphClient, self).handleWorkComplete(packet) print "workcomplete" - self.controller._process_build_graph(packet) + self.controller._process_build_graph(job.data[-1]) return job def handleWorkData(self, packet): diff --git a/gear/worker.py b/gear/worker.py index 0b46a221..35281ca3 100644 --- a/gear/worker.py +++ b/gear/worker.py @@ -27,6 +27,10 @@ while True: cmd = ['morph', 'calculate-build-graph', '--quiet', bg_request['repo'], bg_request['ref'], bg_request['system']] p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) output = p.stdout.read() + # TODO: catch errors calculating build-graph here instead of sending the error as build-graph :) + print "=====" + print output + print "=====" print "DEBUG: finished computing build graph" job.sendWorkComplete(output) -- cgit v1.2.1