Skip to contentSkip to conversation

runqueue: Fix issues with multiconfig deferred task deadlock messages

PATCH New Richard Purdie 1 participant 1 message Sep 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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 | 6 ++++++
 1 file changed, 6 insertions(+)
lib/bb/runqueue.py +6 -0
index f5f25c5b7d..5ccf755f1a 100644
@@ -1904,6 +1904,12 @@ class RunQueueExecute:
                 self.setbuildable(revdep)
                 logger.debug("Marking task %s as buildable", revdep)
 
+        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]
+                update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
+
     def task_complete(self, task):
         self.stats.taskCompleted()
         bb.event.fire(runQueueTaskCompleted(task, self.stats, self.rq), self.cfgData)
Signature · 1 line
2.32.0