From patchwork Thu Dec 1 04:00:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 5411 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id ED5FB23E1A for ; Thu, 1 Dec 2011 04:00:22 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id BF00BA1865B for ; Thu, 1 Dec 2011 04:00:22 +0000 (UTC) Received: by laah2 with SMTP id h2so758026laa.11 for ; Wed, 30 Nov 2011 20:00:22 -0800 (PST) Received: by 10.152.135.179 with SMTP id pt19mr3251828lab.47.1322712022327; Wed, 30 Nov 2011 20:00:22 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs45805lal; Wed, 30 Nov 2011 20:00:21 -0800 (PST) Received: by 10.180.0.100 with SMTP id 4mr3495117wid.48.1322712020277; Wed, 30 Nov 2011 20:00:20 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id z81si1546920weq.138.2011.11.30.20.00.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Nov 2011 20:00:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RVxop-0008Fo-UN for ; Thu, 01 Dec 2011 04:00:19 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id D7CCAE04D7 for ; Thu, 1 Dec 2011 04:00:19 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 103 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 103: fix bug #898000: dispatcher exit status != 0 should lead to job status of INCOMPLETE Message-Id: <20111201040019.10171.93731.launchpad@ackee.canonical.com> Date: Thu, 01 Dec 2011 04:00:19 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14414"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: cacc75ffd89d8286db9ba6fa0a5076425355b487 ------------------------------------------------------------ revno: 103 committer: Michael Hudson-Doyle branch nick: lava-scheduler timestamp: Thu 2011-12-01 16:58:08 +1300 message: fix bug #898000: dispatcher exit status != 0 should lead to job status of INCOMPLETE modified: lava_scheduler_daemon/board.py lava_scheduler_daemon/dbjobsource.py --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === modified file 'lava_scheduler_daemon/board.py' --- lava_scheduler_daemon/board.py 2011-12-01 03:32:52 +0000 +++ lava_scheduler_daemon/board.py 2011-12-01 03:58:08 +0000 @@ -57,7 +57,7 @@ def processEnded(self, reason): self.log_file.close() - self.deferred.callback(None) + self.deferred.callback(reason.value.exitCode) class Job(object): @@ -104,15 +104,15 @@ d.addBoth(self._exited) return d - def _exited(self, result): + def _exited(self, exit_code): self.logger.info("job finished on %s", self.job_data['target']) if self._json_file is not None: os.unlink(self._json_file) self.logger.info("reporting job completed") self._source_lock.run(self._checkCancel_call.stop) return self._source_lock.run( - self.source.jobCompleted, self.board_name).addCallback( - lambda r:result) + self.source.jobCompleted, self.board_name, exit_code).addCallback( + lambda r:exit_code) class SimplePP(ProcessProtocol): === modified file 'lava_scheduler_daemon/dbjobsource.py' --- lava_scheduler_daemon/dbjobsource.py 2011-10-28 05:36:02 +0000 +++ lava_scheduler_daemon/dbjobsource.py 2011-12-01 03:58:08 +0000 @@ -135,7 +135,7 @@ def getLogFileForJobOnBoard(self, board_name): return self.deferForDB(self.getLogFileForJobOnBoard_impl, board_name) - def jobCompleted_impl(self, board_name): + def jobCompleted_impl(self, board_name, exit_code): self.logger.debug('marking job as complete on %s', board_name) device = Device.objects.get(hostname=board_name) if device.status == Device.RUNNING: @@ -149,7 +149,10 @@ job = device.current_job device.current_job = None if job.status == TestJob.RUNNING: - job.status = TestJob.COMPLETE + if exit_code == 0: + job.status = TestJob.COMPLETE + else: + job.status = TestJob.INCOMPLETE elif job.status == TestJob.CANCELING: job.status = TestJob.CANCELED else: @@ -160,8 +163,8 @@ device.save() job.save() - def jobCompleted(self, board_name): - return self.deferForDB(self.jobCompleted_impl, board_name) + def jobCompleted(self, board_name, exit_code): + return self.deferForDB(self.jobCompleted_impl, board_name, exit_code) def jobOobData_impl(self, board_name, key, value): self.logger.info(