From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.26224.1590714517332021995 for ; Thu, 28 May 2020 18:08:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZJbWe5a8; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: bob.c.feng@intel.com) IronPort-SDR: tdEXkA2gsXz3LLktwE9vxNwT/6vriWgvYhcMOBGKFeR/4ezPpvNz5ZY8fRl96Qg1yeNztEelIx s93heF/2av0g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2020 18:08:36 -0700 IronPort-SDR: YF+xpm97mR3NzJODjt+4VnxTl7FwiGpL7vEbOrFtGZjN8/MO6LKCnX6aSJWCdGOPttSMb484RP F64+6SL9FZCg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,446,1583222400"; d="scan'208";a="255950916" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by fmsmga007.fm.intel.com with ESMTP; 28 May 2020 18:08:35 -0700 Received: from orsmsx113.amr.corp.intel.com (10.22.240.9) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 28 May 2020 18:08:35 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by ORSMSX113.amr.corp.intel.com (10.22.240.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 28 May 2020 18:08:35 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 28 May 2020 18:08:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S5eG6JVIp/A6AdlCHTPGcoKGNqHBnp6uOWI6TA4naNNJpfbdzHBMXxjJRLEJkefH9a20rxi1NoXbA/wubthwY1KVMTHUbBSNynEmE9PqNhUHshN7Q4zUppEjkemw29KHT3h1ghR/hQD+PnUHzncBGCPYyKPZn5gxaVsULG52N5E1pYz71cfNUHKhUp7S9Z+TNm+xALPOb06BGtb1X2iV3kH0rHlmKzDuNOvLzyL5m5WLbWF17ZLcwikiVLYRuT00oFV0375NEtBVKC5SOPiND2YgOFNz7dg6yVaIOiQ9nXugOlVjiA43Ot5d/mk6lMpt3+gLnpljYFtgY004ZHpjlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HUYsnVUxOIR11GPepIpUZLDJY4/Ue7UXOdcqcAKGKPU=; b=QXoD5kUvQ3uIpp7Quo/e2Hc5APtMVklKiolVx9J7kcM8aIdNJMVA7VMruVszNG4QxmOcBKLlglxa7V+P2nnGZ3xVCnDCLsJ75OGYf2a0Qm6qqW8k7pWj5oOyDWR0lUHmDaFsABj6052Z7ispFuByhODxA+lkzWYIn7N+aelja5t7IHIceKgkp2PA5sWJ1qtuRuE+ezwk2PQrwUK6xld1GE+zXPrNlmLuiiLUawL3X04wFf/qokvQC6G81QD+MBzbLg31vJMfy48i0kQMDq19f/0gL3RSe4blV1oQi2XXdJ8ZIGr279rzJFid/u9KX6PIVDT5Qh0ldijuknK9LOeTqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HUYsnVUxOIR11GPepIpUZLDJY4/Ue7UXOdcqcAKGKPU=; b=ZJbWe5a8Wn3g6a9HPFvj/N6nHasTNhiq4nskDvhgNW7ZQcPb3KzZnkzfol/qjM2S3qbcZq2GVVSXNiNftF/ybmTDhqdQAxEPQ3hDdbHOyEUMOt3LCRxdRESQ/vaf/Hv1V5tMoxonGbTj1QpclCrPvCNOGcoB8cpm9o06oKM4a/k= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB1521.namprd11.prod.outlook.com (2603:10b6:405:e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Fri, 29 May 2020 01:08:33 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601%6]) with mapi id 15.20.3021.030; Fri, 29 May 2020 01:08:33 +0000 From: "Bob Feng" To: Irene Park , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH] BaseTools/Python: Add missing FatalError handling Thread-Topic: [PATCH] BaseTools/Python: Add missing FatalError handling Thread-Index: AQHWNSWdcXyEbMQw8U+KpT6rZULY+qi+PuiQ Date: Fri, 29 May 2020 01:08:33 +0000 Message-ID: References: <9bbe8b916c10aa4dd79f7cfceb1ed35dd1a8c5f5.1590607347.git.ipark@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ipark@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2020-05-28T19:23:52.4803032Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=bfb9afcc-fe10-436b-88c6-f169291cd995; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 610a0288-7061-451e-2b56-08d8036ccf11 x-ms-traffictypediagnostic: BN6PR11MB1521: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 04180B6720 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: aV4VosZq5mFS1lFjoyYHRflUA5Mj5a56vLXjz1WA2+BjNngbeOMn5ZQNN8n4YYT7r1lTMAnzBz1Lht/4QqtyIqOQ80fiC630aukaXSGCTwyqk428pr5uJc4rMTzq6cKS6KxJ8ih1/y8Lquf4+Rgh+dNnGlacuRcQc2dqy/IVsbq87gIAvlJ5AFozm2sxwazWOu3O1Mm8BOxU0vAL9i0lvLxSVurHTEwiH/HQPRVzwOZfDlvDX1/dgKq4AQBmUIXW3HprbunyuGsraqiq/Pho4AHqYJIe86sjwSZv6g7Rxo7idzcz1l3pBKY7tEJnzD7Q x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(136003)(366004)(376002)(39860400002)(346002)(396003)(52536014)(9686003)(33656002)(66476007)(66946007)(66556008)(66446008)(64756008)(4326008)(55016002)(53546011)(71200400001)(6506007)(110136005)(186003)(26005)(76116006)(2906002)(86362001)(107886003)(5660300002)(7696005)(316002)(478600001)(8936002)(8676002)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: N4E1Rvm8p2roSwKJZi6TZcEwg9RMl2PoBzsnPin+/1kHEnLo35Ah59G4yR3l0I1pigLaiepwAMA0SSMGVwjGE5nVbAnL0smR6CvkUBPvZMHrOvDIxe/mqq9tB5DDL3LAREU0UB+lhiuz6qjGMJKcVZ6O4n+YERFfECg/Z+1aXcjjNo+4u0cwtwEu/fLOHqWjUn12h592/kXMKN2jb9gH7uILP+ceoa8NKLf1uj1DjsdIPKW/dFmkEHyZNMcsk/gzs7UObnqxZsQ1jw26FL7NbgMNu/tBj679G2qdkEIigNTHYL9rKQC3hZPCgTnsBNf3v38gKGyfhWRUtObFUluO6PoPRRnl6eRXC9pWquAy6QBBTY/Ai9reNqbr8EU+FZu+JwSgGTI2S6EgzVdLTXu5NdMxuKTr66ymMWw73wa+0Sfs/guuHSvspJbATGNNfJUWGpSiAwb2srIHMtAD+3l+l+ldYQKIeIF1XTHSa/DLBWeCfSol5K3Qxk4vdQ/lGaKU MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 610a0288-7061-451e-2b56-08d8036ccf11 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 May 2020 01:08:33.6226 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: I0nybjhi2w0s5tSkMJK9cLYC8MXeDb17r73mY8/c4PUTPmNdivbcw6Kj/x9PwrZaDAmh0vkfgf4t4Bwvwg9Uug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1521 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Irene, For this piece of code + self.feedback_q.put(taskname) + self.feedback_q.put(e.args[0]) I think there will be the case that another autogenworker process insert it= s taskname before the current autogenworker process do self.feedback_q.put(= e.args[0]). If that case happens, the build tool will hang. Thanks, Bob -----Original Message----- From: Irene Park =20 Sent: Friday, May 29, 2020 3:24 AM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming Subject: RE: [PATCH] BaseTools/Python: Add missing FatalError handling A gentle reminder and adding Bob Feng and Liming Gao to CC. Thank you, Irene -----Original Message----- From: Irene Park =20 Sent: Wednesday, May 27, 2020 3:42 PM To: devel@edk2.groups.io Cc: Irene Park Subject: [PATCH] BaseTools/Python: Add missing FatalError handling From: Irene Park AutoGenWorker doesn't handle the exception from FatalError therefore the bu= ild fails to return the proper error code at the exit. Signed-off-by: Irene Park --- BaseTools/Source/Python/AutoGen/AutoGenWorker.py | 6 ++++++ BaseTools/Source/Python/build/build.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py b/BaseTools/S= ource/Python/AutoGen/AutoGenWorker.py index 563d91b..2395964 100755 --- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py +++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py @@ -24,6 +24,7 @@ import traceback import sys from AutoGen.DataPipe import MemoryDataPipe import logging +from Common.BuildToolError import FatalError =20 def clearQ(q): try: @@ -101,6 +102,7 @@ class AutoGenManager(threading.Thread): self.autogen_workers =3D autogen_workers self.feedback_q =3D feedback_q self.Status =3D True + self.Error =3D 0 self.error_event =3D error_event def run(self): try: @@ -113,6 +115,7 @@ class AutoGenManager(threading.Thread): fin_num +=3D 1 else: self.Status =3D False + self.Error =3D self.feedback_q.get() self.TerminateWorkers() if fin_num =3D=3D len(self.autogen_workers): self.clearQueue() @@ -282,6 +285,9 @@ class AutoGenWorkerInProcess(mp.Process): =20 except Empty: pass + except FatalError as e: + self.feedback_q.put(taskname) + self.feedback_q.put(e.args[0]) except: self.feedback_q.put(taskname) finally: diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index ed3a3b9..d6e3d84 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -880,7 +880,10 @@ class Build(): =20 self.AutoGenMgr.join() rt =3D self.AutoGenMgr.Status - return rt, 0 + err =3D 0 + if not rt: + err =3D self.AutoGenMgr.Error + return rt, err except FatalError as e: return False, e.args[0] except: -- 2.7.4