All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Reyna, David" <david.reyna@windriver.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	"toaster@lists.yoctoproject.org" <toaster@lists.yoctoproject.org>
Subject: RE: [Toaster] [PATCH] toaster: handle changes to "ImagePkgList" event
Date: Mon, 21 Mar 2022 00:18:19 +0000	[thread overview]
Message-ID: <BY5PR11MB4167E128756A3935EA08C44FEA169@BY5PR11MB4167.namprd11.prod.outlook.com> (raw)
In-Reply-To: <89bc951abe2d02689688b1c43d7465d5751b489d.camel@linuxfoundation.org>

[-- Attachment #1: Type: text/plain, Size: 1857 bytes --]

> I'm seeing builds reach 100% and then just hang in the toaster UI never completing.

See my recent patch for 14765 (attached).

I discovered that new race condition with long builds where the end-of-build event has the build record success outcome properly set, but that commit never makes it in time to the physical database before the build tear-down. It may be related to the upgrade to Django 3 (and if so it is the only oddity with Tim's Django 3 I have encountered).

David

-----Original Message-----
From: toaster@lists.yoctoproject.org <toaster@lists.yoctoproject.org> On Behalf Of Richard Purdie
Sent: Sunday, March 20, 2022 3:44 PM
To: Reyna, David <david.reyna@windriver.com>; toaster@lists.yoctoproject.org
Subject: Re: [Toaster] [PATCH] toaster: handle changes to "ImagePkgList" event

Hi David,

On Sun, 2022-03-20 at 22:37 +0000, Reyna, David wrote:
> Hi Richard,
> 
> Your proposed patch works perfectly. All the anomalies disappeared. I will drop my workaround patch and submit your patch instead.
> 
> I do have a limitation in that I am only setup to submit patches to bitbake, and not to oe-core. Could someone point me to those instructions, or could you pass that patch to them directly?

Thanks for testing, I'm glad it works and sorted the anomalies. I've sent it to
the OE-Core list and queued it for testing:

https://git.yoctoproject.org/poky/commit/?h=master-next&id=c94d49a769244e72df6631fdd4078cd1ad317e04

I did try and do some testing myself however I'm seeing builds reach 100% and
then just hang in the toaster UI never completing. It didn't matter if I ran
them from the UI or the commandline.

Have you seen anything like that before? It could be some issue with my local
setup or corruption from something previous, I'll try and dig a little more
tomorrow.

Cheers,

Richard


[-- Attachment #2: Type: message/rfc822, Size: 12380 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1115 bytes --]

From: David Reyna <David.Reyna@windriver.com>

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 <David.Reyna@windriver.com>
---
 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):
--
2.17.1


[-- Attachment #2.1.2: ATT00001.txt --]
[-- Type: text/plain, Size: 398 bytes --]


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5783): https://lists.yoctoproject.org/g/toaster/message/5783
Mute This Topic: https://lists.yoctoproject.org/mt/89883147/3616810
Group Owner: toaster+owner@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub [david.reyna@windriver.com]
-=-=-=-=-=-=-=-=-=-=-=-


  parent reply	other threads:[~2022-03-21  0:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 10:43 [PATCH] toaster: handle changes to "ImagePkgList" event David Reyna
2022-03-18 10:49 ` [Toaster] " Richard Purdie
2022-03-18 19:26   ` Reyna, David
2022-03-19 20:02     ` Richard Purdie
2022-03-20  7:14       ` Reyna, David
     [not found]       ` <16DE057272F55985.7848@lists.yoctoproject.org>
2022-03-20 22:37         ` Reyna, David
     [not found]           ` <89bc951abe2d02689688b1c43d7465d5751b489d.camel@linuxfoundation.org>
2022-03-21  0:18             ` Reyna, David [this message]
2022-03-21 15:20               ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BY5PR11MB4167E128756A3935EA08C44FEA169@BY5PR11MB4167.namprd11.prod.outlook.com \
    --to=david.reyna@windriver.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=toaster@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.