Skip to contentSkip to conversation

toaster: race condition for end-of-build

PATCH New David Reyna 1 participant 1 message Mar 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toaster: race condition for end-of-build

From: David Reyna <[email protected]>

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]

---
 bitbake/lib/bb/ui/buildinfohelper.py | 6 ++++++
 1 file changed, 6 insertions(+)
bitbake/lib/bb/ui/buildinfohelper.py +6 -0
index 5559387d8e..ec036e3b14 100644
@@ -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):
Signature · 1 line
2.17.1