From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B220BE0096D; Wed, 23 Mar 2016 03:36:34 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.88 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4FFFCE009C3 for ; Wed, 23 Mar 2016 03:36:26 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 23 Mar 2016 03:36:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,382,1455004800"; d="scan'208";a="930082632" Received: from linux.intel.com ([10.23.219.25]) by fmsmga001.fm.intel.com with ESMTP; 23 Mar 2016 03:36:24 -0700 Received: from vmed.fi.intel.com (vmed.fi.intel.com [10.237.72.51]) by linux.intel.com (Postfix) with ESMTP id CCA5D6A4002 for ; Wed, 23 Mar 2016 04:24:07 -0700 (PDT) From: Ed Bartosh To: toaster@yoctoproject.org Date: Wed, 23 Mar 2016 10:15:09 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [PATCH v6 18/41] toasterui: shutdown on BuildCompleted event 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: Wed, 23 Mar 2016 10:36:34 -0000 toasterui exits event loop on one of the following events: CommandCompleted, CommandFailed or CommandExit. Unfortunately none of them come from bitbake when build fails. This is normai if toasterui runs in observer mode. However, if it's in build mode this causes toasterui to stuck in the infinite loop waiting for new events. The only event we can rely on is BuildCompleted as it always comes from bitbake unlike 3 above mentioned events. Modified the code to always shutdown toasterui in build mode on BuildCompleted event. Signed-off-by: Ed Bartosh --- bitbake/lib/bb/ui/toasterui.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py index 593d983..8467978 100644 --- a/bitbake/lib/bb/ui/toasterui.py +++ b/bitbake/lib/bb/ui/toasterui.py @@ -378,11 +378,14 @@ def main(server, eventHandler, params): buildinfohelper.close(errorcode) # we start a new build info - logger.debug("ToasterUI prepared for new build") - errors = 0 - warnings = 0 - taskfailures = [] - buildinfohelper = BuildInfoHelper(server, build_history_enabled) + if params.observe_only: + logger.debug("ToasterUI prepared for new build") + errors = 0 + warnings = 0 + taskfailures = [] + buildinfohelper = BuildInfoHelper(server, build_history_enabled) + else: + main.shutdown = 1 logger.info("ToasterUI build done, brbe: %s", brbe) continue -- 2.1.4