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:11:37 -1000 |
| commit | 201362ccb62f0ed3c3b2a0d7904bb9e94b291242 (patch) | |
| tree | 36cee14da0c0fae469c515fa84ea3c4a5d62af9e /bitbake/lib/bb | |
| parent | 84dd3d0e6c90656f2a7105aabd303a62fa49eeba (diff) | |
| download | poky-201362ccb62f0ed3c3b2a0d7904bb9e94b291242.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: 907416ee1062f87f5844ab0638b54616abfc1a22)
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/lib/bb')
| -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 ba75660555..569520707b 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
| @@ -1974,11 +1974,19 @@ class RunQueueExecute: | |||
| 1974 | self.setbuildable(revdep) | 1974 | self.setbuildable(revdep) |
| 1975 | logger.debug("Marking task %s as buildable", revdep) | 1975 | logger.debug("Marking task %s as buildable", revdep) |
| 1976 | 1976 | ||
| 1977 | for t in self.sq_deferred.copy(): | 1977 | found = None |
| 1978 | for t in sorted(self.sq_deferred.copy()): | ||
| 1978 | if self.sq_deferred[t] == task: | 1979 | if self.sq_deferred[t] == task: |
| 1979 | logger.debug2("Deferred task %s now buildable" % t) | 1980 | # Allow the next deferred task to run. Any other deferred tasks should be deferred after that task. |
| 1980 | del self.sq_deferred[t] | 1981 | # We shouldn't allow all to run at once as it is prone to races. |
| 1981 | update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False) | 1982 | if not found: |
| 1983 | bb.note("Deferred task %s now buildable" % t) | ||
| 1984 | del self.sq_deferred[t] | ||
| 1985 | update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False) | ||
| 1986 | found = t | ||
| 1987 | else: | ||
| 1988 | bb.note("Deferring %s after %s" % (t, found)) | ||
| 1989 | self.sq_deferred[t] = found | ||
| 1982 | 1990 | ||
| 1983 | def task_complete(self, task): | 1991 | def task_complete(self, task): |
| 1984 | self.stats.taskCompleted() | 1992 | self.stats.taskCompleted() |
