From patchwork Sat Mar 19 02:58:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Reyna, David" X-Patchwork-Id: 5503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C94CFC433F5 for ; Sat, 19 Mar 2022 02:58:54 +0000 (UTC) Received: from mail1.wrs.com (mail1.wrs.com [147.11.3.146]) by mx.groups.io with SMTP id smtpd.web10.3523.1647658734303907447 for ; Fri, 18 Mar 2022 19:58:54 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 147.11.3.146, mailfrom: david.reyna@windriver.com) Received: from mail.windriver.com (mail.wrs.com [147.11.1.11]) by mail1.wrs.com (8.15.2/8.15.2) with ESMTPS id 22J2wqtR011562 (version=TLSv1.1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 18 Mar 2022 19:58:53 -0700 Received: from ala-exchng01.corp.ad.wrs.com (ala-exchng01.corp.ad.wrs.com [147.11.82.252]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 22J2wq5A003273 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 18 Mar 2022 19:58:52 -0700 (PDT) Received: from ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 18 Mar 2022 19:58:51 -0700 Received: from ala-exchng01.corp.ad.wrs.com (147.11.82.252) by ALA-EXCHNG02.corp.ad.wrs.com (147.11.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 18 Mar 2022 19:58:51 -0700 Received: from ala-lpggp2.wrs.com (147.11.105.123) by ala-exchng01.corp.ad.wrs.com (147.11.82.252) with Microsoft SMTP Server id 15.1.2242.12 via Frontend Transport; Fri, 18 Mar 2022 19:58:50 -0700 From: David Reyna To: Subject: [PATCH] toaster: race condition for end-of-build Date: Fri, 18 Mar 2022 19:58:50 -0700 Message-ID: <20220319025850.110353-1-david.reyna@windriver.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 19 Mar 2022 02:58:54 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/toaster/message/5783 From: David Reyna Force a sync point for end-of build event handler force the build's outcome status commit, to resolve a race condition with the build completion takedown. [YOCTO #14765] Signed-off-by: David Reyna --- bitbake/lib/bb/ui/buildinfohelper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 5559387d8e..ec036e3b14 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -228,6 +228,12 @@ class ORMWrapper(object): build.completed_on = timezone.now() build.outcome = outcome build.save() + + # We force a sync point here to force the outcome status commit, + # which resolves a race condition with the build completion takedown + transaction.set_autocommit(True) + transaction.set_autocommit(False) + signal_runbuilds() def update_target_set_license_manifest(self, target, license_manifest_path):