aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-28 12:14:42 +0100
committerSteve Sakoman <steve@sakoman.com>2023-06-29 09:29:41 -1000
commit08033b63ae442c774bd3fce62844eac23e6882d7 (patch)
tree11a8384432a213ec349f5f342a6c647e9a607b5e
parentd97d62e2cbe4bae17f0886f3b4759e8f9ba6d38c (diff)
downloadbitbake-08033b63ae442c774bd3fce62844eac23e6882d7.tar.gz
runqueue: Fix deferred task/multiconfig race issueyocto-4.2.3yocto-4.2.22023-04.3-mickledore2023-04.2-mickledore2.4.32.4.2
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9523e28658ad7fb446645b590608dfac2812afd3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--lib/bb/runqueue.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 02f147454..99fac6361 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1991,11 +1991,19 @@ class RunQueueExecute:
self.setbuildable(revdep)
logger.debug("Marking task %s as buildable", revdep)
- for t in self.sq_deferred.copy():
+ found = None
+ for t in sorted(self.sq_deferred.copy()):
if self.sq_deferred[t] == task:
- logger.debug2("Deferred task %s now buildable" % t)
- del self.sq_deferred[t]
- update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
+ # Allow the next deferred task to run. Any other deferred tasks should be deferred after that task.
+ # We shouldn't allow all to run at once as it is prone to races.
+ if not found:
+ bb.note("Deferred task %s now buildable" % t)
+ del self.sq_deferred[t]
+ update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
+ found = t
+ else:
+ bb.note("Deferring %s after %s" % (t, found))
+ self.sq_deferred[t] = found
def task_complete(self, task):
self.stats.taskCompleted()