summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/runqueue.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-28 12:14:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-28 23:02:50 +0100
commitc62d8b3006b8ee0a915fc8215f39bfc3d7b3a591 (patch)
tree07efd3d534eb411533d5eb276f81a73d97820235 /bitbake/lib/bb/runqueue.py
parentec8899f3ab843e6f612c9ffa545a0a48431ccc39 (diff)
downloadpoky-c62d8b3006b8ee0a915fc8215f39bfc3d7b3a591.tar.gz
bitbake: runqueue: Fix deferred task/multiconfig race issue
If there are several multiconfigs in play for example a non-multiconfig with a task with one hash and then three multiconfigs for the same task, different architectures but the same hash (different to the non-mc), the three mcs will be deferred until after the non-mc task but then will all run together and race against each other. Change the code to re-enable deferred tasks one at a time. This way, if they do race, they won't run in parallel against each other. (Bitbake rev: 9523e28658ad7fb446645b590608dfac2812afd3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r--bitbake/lib/bb/runqueue.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 0bb3bc20ab..241a746ebb 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1991,11 +1991,19 @@ class RunQueueExecute:
1991 self.setbuildable(revdep) 1991 self.setbuildable(revdep)
1992 logger.debug("Marking task %s as buildable", revdep) 1992 logger.debug("Marking task %s as buildable", revdep)
1993 1993
1994 for t in self.sq_deferred.copy(): 1994 found = None
1995 for t in sorted(self.sq_deferred.copy()):
1995 if self.sq_deferred[t] == task: 1996 if self.sq_deferred[t] == task:
1996 logger.debug2("Deferred task %s now buildable" % t) 1997 # Allow the next deferred task to run. Any other deferred tasks should be deferred after that task.
1997 del self.sq_deferred[t] 1998 # We shouldn't allow all to run at once as it is prone to races.
1998 update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False) 1999 if not found:
2000 bb.note("Deferred task %s now buildable" % t)
2001 del self.sq_deferred[t]
2002 update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
2003 found = t
2004 else:
2005 bb.note("Deferring %s after %s" % (t, found))
2006 self.sq_deferred[t] = found
1999 2007
2000 def task_complete(self, task): 2008 def task_complete(self, task):
2001 self.stats.taskCompleted() 2009 self.stats.taskCompleted()