diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-19 14:25:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-22 23:12:12 +0000 |
commit | e18bb3f56bfe7c3a6ad2998dd25c5c48763b0821 (patch) | |
tree | 0c3d3261be2f6f25f0e67bb07e9ae14317a74543 /bitbake/lib | |
parent | aa7f7662b2ed16e3a74e6ca185803dc2afa09541 (diff) | |
download | poky-e18bb3f56bfe7c3a6ad2998dd25c5c48763b0821.tar.gz |
bitbake: runqueue: Fix hash equivalence duplicate tasks running
The key problem is that currently running setscene tasks are not
accounted for when processing task migrations. This means can allow
two of the same task to execute at the same time with unpredictable
effects.
This change allows us to stop doing that and refactor the code slightly
to make it clearer that these conditions don't arrive even with
deferred tasks.
(Bitbake rev: ac1922d348613ca46a1047ad5ddf755eac16d568)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 8622738fd9..26492e7087 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -2303,16 +2303,22 @@ class RunQueueExecute: | |||
2303 | for tid in changed: | 2303 | for tid in changed: |
2304 | if tid not in self.rqdata.runq_setscene_tids: | 2304 | if tid not in self.rqdata.runq_setscene_tids: |
2305 | continue | 2305 | continue |
2306 | if tid not in self.pending_migrations: | ||
2307 | self.pending_migrations.add(tid) | ||
2308 | |||
2309 | for tid in self.pending_migrations.copy(): | ||
2306 | if tid in self.runq_running: | 2310 | if tid in self.runq_running: |
2311 | # Too late, task already running, not much we can do now | ||
2312 | self.pending_migrations.remove(tid) | ||
2307 | continue | 2313 | continue |
2308 | if tid in self.scenequeue_covered: | 2314 | |
2315 | if tid in self.scenequeue_covered or tid in self.sq_live: | ||
2316 | # Already ran this setscene task or it running | ||
2309 | # Potentially risky, should we report this hash as a match? | 2317 | # Potentially risky, should we report this hash as a match? |
2310 | logger.info("Already covered setscene for %s so ignoring rehash" % (tid)) | 2318 | logger.info("Already covered setscene for %s so ignoring rehash" % (tid)) |
2319 | self.pending_migrations.remove(tid) | ||
2311 | continue | 2320 | continue |
2312 | if tid not in self.pending_migrations: | ||
2313 | self.pending_migrations.add(tid) | ||
2314 | 2321 | ||
2315 | for tid in self.pending_migrations.copy(): | ||
2316 | valid = True | 2322 | valid = True |
2317 | # Check no tasks this covers are running | 2323 | # Check no tasks this covers are running |
2318 | for dep in self.sqdata.sq_covered_tasks[tid]: | 2324 | for dep in self.sqdata.sq_covered_tasks[tid]: |