summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-19 14:25:20 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-22 23:12:12 +0000
commite18bb3f56bfe7c3a6ad2998dd25c5c48763b0821 (patch)
tree0c3d3261be2f6f25f0e67bb07e9ae14317a74543
parentaa7f7662b2ed16e3a74e6ca185803dc2afa09541 (diff)
downloadpoky-e18bb3f56bfe7c3a6ad2998dd25c5c48763b0821.tar.gz
poky-e18bb3f56bfe7c3a6ad2998dd25c5c48763b0821.tar.bz2
poky-e18bb3f56bfe7c3a6ad2998dd25c5c48763b0821.zip
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>
-rw-r--r--bitbake/lib/bb/runqueue.py14
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:
for tid in changed:
if tid not in self.rqdata.runq_setscene_tids:
continue
+ if tid not in self.pending_migrations:
+ self.pending_migrations.add(tid)
+
+ for tid in self.pending_migrations.copy():
if tid in self.runq_running:
+ # Too late, task already running, not much we can do now
+ self.pending_migrations.remove(tid)
continue
- if tid in self.scenequeue_covered:
+
+ if tid in self.scenequeue_covered or tid in self.sq_live:
+ # Already ran this setscene task or it running
# Potentially risky, should we report this hash as a match?
logger.info("Already covered setscene for %s so ignoring rehash" % (tid))
+ self.pending_migrations.remove(tid)
continue
- if tid not in self.pending_migrations:
- self.pending_migrations.add(tid)
- for tid in self.pending_migrations.copy():
valid = True
# Check no tasks this covers are running
for dep in self.sqdata.sq_covered_tasks[tid]: