pnoltes commented on code in PR #476:
URL: https://github.com/apache/celix/pull/476#discussion_r1117904498
##########
libs/framework/src/framework_bundle_lifecycle_handler.c:
##########
@@ -83,31 +90,32 @@ void
celix_framework_cleanupBundleLifecycleHandlers(celix_framework_t* fw, bool
celixThreadMutex_unlock(&fw->bundleLifecycleHandling.mutex);
}
-static void
celix_framework_createAndStartBundleLifecycleHandler(celix_framework_t* fw,
celix_framework_bundle_entry_t* bndEntry, enum celix_bundle_lifecycle_command
bndCommand) {
+static void
celix_framework_createAndStartBundleLifecycleHandler(celix_framework_t* fw,
celix_framework_bundle_entry_t* bndEntry, enum celix_bundle_lifecycle_command
bndCommand, const char* updatedBundleUrl) {
celix_framework_bundleEntry_increaseUseCount(bndEntry);
celixThreadMutex_lock(&fw->bundleLifecycleHandling.mutex);
celix_framework_bundle_lifecycle_handler_t* handler = calloc(1,
sizeof(*handler));
handler->command = bndCommand;
handler->framework = fw;
handler->bndEntry = bndEntry;
handler->bndId = bndEntry->bndId;
+ handler->updatedBundleUrl = celix_utils_strdup(updatedBundleUrl);
celix_arrayList_add(fw->bundleLifecycleHandling.bundleLifecycleHandlers,
handler);
fw_log(fw->logger, CELIX_LOG_LEVEL_TRACE, "Creating thread for %s bundle
%li",
celix_bundleLifecycleCommand_getDesc(handler->command) ,
handler->bndId);
- celixThread_create(&handler->thread, NULL,
celix_framework_stopStartBundleThread, handler);
+ celixThread_create(&handler->thread, NULL,
celix_framework_BundleLifecycleHandlingThread, handler);
Review Comment:
That could indeed be an issue.
Note that the bundle to stop and uninstall are collected during framework
shutdown:
https://github.com/apache/celix/blob/feature/refactor_bundle_cache/libs/framework/src/framework.c#L1201-L1214
I think what is missing is to also then mark the framework as shutting down
and not allowing any new bundle changes (install, stopping, starting, etc).
But IMO an improvement for another PR
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]