ahgittin commented on a change in pull request #1163:
URL: https://github.com/apache/brooklyn-server/pull/1163#discussion_r614860765



##########
File path: 
core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
##########
@@ -650,6 +662,15 @@ private boolean hasTaskAsAncestor(Task<?> t, Task<?> 
potentialAncestor) {
         return hasTaskAsAncestor(t.getSubmittedByTask(), potentialAncestor);
     }
 
+    private Task<?> getRootTask(Task<?> t) {
+        Task<?> result = t;
+        while (t!=null) {
+            result = t;
+            t = t.getSubmittedByTask();

Review comment:
       it is logically impossible and should be considered an illegal model for 
a task to claim to submit itself (or to have any recursive cycle here).  it 
would be ugly here if either of those happened (endless loop here) but it 
really shouldn't, easy to identify with `jstack`, and IMO isn't worth extra 
checks or tracking here to guard against an illegal model.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to