runqueue: Fix issues with multiconfig deferred task deadlock messages
PATCH 1/2 runqueue: Fix issues with multiconfig deferred task deadlock messages
In multiconfig builds with large numbers of identical tasks, builds were deadlocking after recent runqueue changes upon rebuilds where there was heavy sstate usage (i.e. on second builds after a first completed).
The issue was that deferred tasks were being left indefinitely on the deferred list. The deadlock handler was then "breaking" things by failing tasks that had already succeeded, leading to the task being on both covered and not covered lists, giving a further error.
The fix is to clean up the deferred task list when each setscene task completes. I'd previously been hoping to avoid iterating that list but it appears unavoidable.
[YOCTO #14342]
--- lib/bb/runqueue.py | 5 +++++ 1 file changed, 5 insertions(+)
lib/bb/runqueue.py +5 -0
@@ -2492,6 +2492,11 @@ class RunQueueExecute: self.holdoff_need_update = True + for t in self.sq_deferred.copy(): + if self.sq_deferred[t] == task: + logger.debug2("Deferred task %s now buildable" % t) + del self.sq_deferred[t] + def sq_task_completeoutright(self, task): """ Mark a task as completed
Signature · 1 line
2.32.0
PATCH 2/2 runqueue: Avoid deadlock avoidance task graph corruption
If the deferred task deadlock avoidance code triggers, it could mark an executed task as failed which leads to "covered and not covered" error messages. Improve the logic so if the deadlock code is triggered, it doesn't cause the errors.
--- lib/bb/runqueue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/runqueue.py +2 -1
@@ -2180,7 +2180,8 @@ class RunQueueExecute: if self.sq_deferred: tid = self.sq_deferred.pop(list(self.sq_deferred.keys())[0]) logger.warning("Runqeueue deadlocked on deferred tasks, forcing task %s" % tid) - self.sq_task_failoutright(tid) + if tid not in self.runq_complete: + self.sq_task_failoutright(tid) return True if len(self.failed_tids) != 0:
Signature · 1 line
2.32.0