diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-28 12:14:42 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-07-07 04:30:25 -1000 |
commit | 5e72da9780f6ea95dba9d59ee88c17cb69e416c8 (patch) | |
tree | 5edc42ae4041868b9c4fe8e1de7c3d08b56a6d4f | |
parent | c9d5df0cddb1e335e780fce995a0ee0660d5ac6e (diff) | |
download | poky-5e72da9780f6ea95dba9d59ee88c17cb69e416c8.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: 08033b63ae442c774bd3fce62844eac23e6882d7)
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-- | bitbake/lib/bb/runqueue.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 02f1474540..99fac63616 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() |