pnoltes commented on code in PR #560:
URL: https://github.com/apache/celix/pull/560#discussion_r1203564838


##########
libs/framework/src/dm_dependency_manager_impl.c:
##########
@@ -261,6 +265,11 @@ celix_array_list_t * 
celix_dependencyManager_createInfos(celix_dependency_manage
 
 static void celix_dm_allComponentsActiveCallback(void *handle, const 
celix_bundle_t *bnd) {
        bool *allActivePtr = handle;
+
+    if (celix_bundle_getState(bnd) != CELIX_BUNDLE_STATE_ACTIVE) {
+        return;
+    }
+

Review Comment:
   > I'm afraid this is not enough: nothing stops the bundle from stopping 
after this check. Note that 
`celix_framework_bundleEntry_getBundleEntryAndIncreaseUseCount` does not 
protect bundle state from being changed. #557 is closely related.
   
   You are right. I though stop already waited until a empty bundle use count, 
but this is only done for uninstall:
   
https://github.com/apache/celix/blob/master/libs/framework/src/framework.c#L1921
   
   IMO the underlining issue here that getting info for components of other 
bundles is done through the bundle context of other bundles and this is wrong. 
Maybe we need something like a component registry, as is done with service 
(service registry). I will create an issue for this.
   
   #557 is of course also an issue, but I think the solution here is maybe not 
allowing multiple bundle lifecycle calls or at least not on the same bundle. 



-- 
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-unsubscr...@celix.apache.org

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

Reply via email to