You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2022/06/27 12:54:17 UTC

[GitHub] [brooklyn-server] algairim commented on a diff in pull request #1325: Fix persistence deletion race

algairim commented on code in PR #1325:
URL: https://github.com/apache/brooklyn-server/pull/1325#discussion_r907355718


##########
core/src/main/java/org/apache/brooklyn/core/entity/Entities.java:
##########
@@ -948,10 +955,22 @@ public static ManagementContext startManagement(Application app, ManagementConte
             }
         }
 
+        premanageRecursively((ManagementContextInternal)mgmt, app);
+
         mgmt.getEntityManager().manage(app);
         return mgmt;
     }
 
+    private static void premanageRecursively(ManagementContextInternal mgmt, Entity e) {
+        if (Entities.isUnmanagingOrNoLongerManaged(e) || Entities.isManagedActive(e)) {
+            log.warn("Skipping premanagement for "+e+", as it has some form of known management");
+            // skip for active and unmanaged entities
+            return;
+        }
+        mgmt.prePreManage(e);

Review Comment:
   Can it be that this condition is required for a particular entity, but not for its children?



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org