[oe-commits] [bitbake] 21/40: toaster: prevent infinite loop when finding task dependencies
git at git.openembedded.org
git at git.openembedded.org
Wed Aug 10 23:12:04 UTC 2016
rpurdie pushed a commit to branch master
in repository bitbake.
commit 88c471c7e5995abb5bca62990b91650277b6c926
Author: Elliot Smith <elliot.smith at intel.com>
AuthorDate: Fri Jul 29 12:25:46 2016 +0100
toaster: prevent infinite loop when finding task dependencies
Toaster occasionally records a task which depends on itself.
This causes a problem when trying to display that task if it
is "covered" by itself, as the code does the following: for
task A, find a task B which covers A; then, recursively
find the task which covers B etc. If B == A, this loop becomes
infinite and never terminates.
To prevent this, add the condition that, when finding a task B
which covers A, don't allow B == A.
[YOCTO #9952]
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
lib/toaster/toastergui/views.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py
index a40ceef..3411806 100755
--- a/lib/toaster/toastergui/views.py
+++ b/lib/toaster/toastergui/views.py
@@ -822,11 +822,21 @@ def _find_task_dep(task_object):
def _find_task_revdep(task_object):
tdeps = Task_Dependency.objects.filter(depends_on=task_object).filter(task__order__gt=0)
tdeps = tdeps.exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
+
+ # exclude self-dependencies to prevent infinite dependency loop
+ # in generateCoveredList2()
+ tdeps = tdeps.exclude(task=task_object)
+
return [tdep.task for tdep in tdeps]
def _find_task_revdep_list(tasklist):
tdeps = Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0)
tdeps = tdeps.exclude(task__outcome=Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
+
+ # exclude self-dependencies to prevent infinite dependency loop
+ # in generateCoveredList2()
+ tdeps = tdeps.exclude(task=F('depends_on'))
+
return [tdep.task for tdep in tdeps]
def _find_task_provider(task_object):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list