PengZheng opened a new issue, #556:
URL: https://github.com/apache/celix/issues/556
The behavior of the `uninstall()` method of Bundle interface is specified as
follows:
> To whatever extent possible, the Framework must remove any resources
related to the bundle. This method must always uninstall the bundle from the
persistent storage of the Framework.
Clearly, the current implementation, which is introduced by #476, does not
touch persistent storage.
As seen in `TEST_F(CxxBundleArchiveTestSuite, BundleArchiveReusedTest)`,
after uninstall, the bundle archive is intact.
#554 tries to fix this, but fails to take `celix_bundleCache`, which assumes
that "bundle cache dirs are not removed" (see
`celix_bundleCache_updateIdForLocationLookupMap`), into account, and thus is
withdrawn in #555.
Also note that there are a condition in current implementation of
`celix_framework_installBundle` and `celix_framework_installBundleAsync`: if
the same bundle are installed concurrently from multiple threads, it can happen
that multiple copies of the same bundle will be installed into the bundle cache
with different bundle ids.
```C
long alreadyExistingBndId =
celix_bundleCache_findBundleIdForLocation(framework, bndLoc);
//FIXME: first check then do
long id = alreadyExistingBndId == -1 ?
framework_getNextBundleId(framework) : alreadyExistingBndId;
bundle_archive_t* archive = NULL;
status = CELIX_DO_IF(status,
celix_bundleCache_createArchive(framework, id, bndLoc, &archive));
```
Any future fix should also address the thread safety issue.
--
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]