Skip to contentSkip to conversation

runqueue: Fix dependency loop analysis 'hangs'

PATCH New Richard Purdie 1 participant 1 message Feb 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqueue: Fix dependency loop analysis 'hangs'

Currently the mechanism for breaking out of the dependnecy loop analysis code is broken and doesn't work leading to bitbake appearing to hang.

Add in a custom exception for this purpose and fix the code to exit as intended, fixing the hang and making the dependency loop code usable again.

---
 lib/bb/runqueue.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
lib/bb/runqueue.py +9 -3
index 80ae8a2a46..71f178de4f 100644
@@ -410,6 +410,9 @@ class RunQueueData:
         explored_deps = {}
         msgs = []
 
+        class TooManyLoops(Exception):
+            pass
+
         def chain_reorder(chain):
             """
             Reorder a dependency chain so the lowest task id is first
@@ -462,7 +465,7 @@ class RunQueueData:
                         msgs.append("\n")
                     if len(valid_chains) > 10:
                         msgs.append("Aborted dependency loops search after 10 matches.\n")
-                        return msgs
+                        raise TooManyLoops
                     continue
                 scan = False
                 if revdep not in explored_deps:
@@ -481,8 +484,11 @@ class RunQueueData:
 
             explored_deps[tid] = total_deps
 
-        for task in tasks:
-            find_chains(task, [])
+        try:
+            for task in tasks:
+                find_chains(task, [])
+        except TooManyLoops:
+            pass
 
         return msgs
 
Signature · 1 line
2.20.1