diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-28 12:14:42 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-07-12 05:13:58 -1000 |
commit | bc3497092e819715f25228cbcc2a68e904f4b2de (patch) | |
tree | 4e31a422c574bebbf5f53c6c5e5dc55c88329c4b /bitbake | |
parent | 642040373e3da78c3ae4c1f428ef2d664e7db817 (diff) | |
download | poky-bc3497092e819715f25228cbcc2a68e904f4b2de.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: b60c7085ec370473bea9b3b4b65826a17638837f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9523e28658ad7fb446645b590608dfac2812afd3)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake')
-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 2a1299db39..886eef1f27 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1975,11 +1975,19 @@ class RunQueueExecute: | |||
1975 | self.setbuildable(revdep) | 1975 | self.setbuildable(revdep) |
1976 | logger.debug(1, "Marking task %s as buildable", revdep) | 1976 | logger.debug(1, "Marking task %s as buildable", revdep) |
1977 | 1977 | ||
1978 | for t in self.sq_deferred.copy(): | 1978 | found = None |
1979 | for t in sorted(self.sq_deferred.copy()): | ||
1979 | if self.sq_deferred[t] == task: | 1980 | if self.sq_deferred[t] == task: |
1980 | logger.debug(2, "Deferred task %s now buildable" % t) | 1981 | # Allow the next deferred task to run. Any other deferred tasks should be deferred after that task. |
1981 | del self.sq_deferred[t] | 1982 | # We shouldn't allow all to run at once as it is prone to races. |
1982 | update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False) | 1983 | if not found: |
1984 | bb.note("Deferred task %s now buildable" % t) | ||
1985 | del self.sq_deferred[t] | ||
1986 | update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False) | ||
1987 | found = t | ||
1988 | else: | ||
1989 | bb.note("Deferring %s after %s" % (t, found)) | ||
1990 | self.sq_deferred[t] = found | ||
1983 | 1991 | ||
1984 | def task_complete(self, task): | 1992 | def task_complete(self, task): |
1985 | self.stats.taskCompleted() | 1993 | self.stats.taskCompleted() |