summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
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-25 21:26:15 +0000
commit3e8e6700cc1e6842f1621f715b9dad1c529fda66 (patch)
tree797869d00e9530ac32d1ca0076288ae019d3b4d0 /bitbake/lib/bb
parent49bc773cd0852dcdf3c3796a52bce7e3fef28217 (diff)
downloadpoky-3e8e6700cc1e6842f1621f715b9dad1c529fda66.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: 33ffc2128b1a74fa7179a8341db68cddf402536f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-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 18049436fd..02a9b912fa 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]: