Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id A3A73E00CCC; Wed, 6 Sep 2017 21:17:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [147.11.1.11 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id F17AEE00CC8 for ; Wed, 6 Sep 2017 21:17:27 -0700 (PDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id v874HQ47008430 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 6 Sep 2017 21:17:26 -0700 (PDT) Received: from ala-dreyna-lx3.corp.ad.wrs.com (147.11.157.78) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 6 Sep 2017 21:17:25 -0700 From: David Reyna To: Date: Wed, 6 Sep 2017 21:09:11 -0700 Message-ID: <1504757351-20450-1-git-send-email-david.reyna@windriver.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [147.11.157.78] Subject: [PATCH] toaster: report and stop builds on git and server exceptions X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 04:17:28 -0000 Content-Type: text/plain From: David Reyna Stop the pending build and report to the user if there is an internal exception due to a git error, a bitbake server error, or if the server-only mode halts due to for example a user syntax error in a layer or recipe. These exceptions were not caught because they occured before the normal toastergui processing was started. [YOCTO #12056] Signed-off-by: David Reyna --- bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py index 8eacb5e..791e53e 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py @@ -79,6 +79,14 @@ class Command(BaseCommand): br.save() bec.be.lock = BuildEnvironment.LOCK_FREE bec.be.save() + # Cancel the pending build and report the exception to the UI + log_object = LogMessage.objects.create( + build = br.build, + level = LogMessage.EXCEPTION, + message = errmsg) + log_object.save() + br.build.outcome = Build.FAILED + br.build.save() def archive(self): for br in BuildRequest.objects.filter(state=BuildRequest.REQ_ARCHIVE): -- 1.9.1