+ 1 on the idea of the four steps mentioned. Can we look into a way this can be triggered selectively with some command-line option or an offline command? Reason to keep this logic from slowing down the startup in production run.
In addition to that, in future, we could able to enhance the same logic to allow similar behavior like "windows System Restore Point" or "OSX time machine" to revert to known point of WUM, by version controlling the bundle-info and the respective jars/configs. Cheers, Ruwan On Wed, May 17, 2017 at 9:21 AM, Jayanga Dissanayake <[email protected]> wrote: > Hi All, > > Existing OSGi deployment logic [1] keep updating the bundles.info file as > and when a bundle is added/removed from the [product_home]/lib directory. > > 1. It first read the bundles.info file of the current runtime > 2. Then take the list of bundles coming from "plugins" directory. > 3. Adds the bundles in the [product_home]/lib directory to the previous > list > 4. Get distinct bundles based on the bundle symbolic name and version. > (ignores bundles with same symbolic name and version already in the list, > hence bundles in the plugins directory get the priority) > 5. Update the bundles.info file > > The above-mentioned approach assumes all basic bundles for the runtime > coming from the "plugins" directory and adds the external bundles on top of > it. > > Recently we were looking into the C5 update/patching model and there was a > concern on how we could add a temporary log patches, etc. to identify an > issue. (in a case where all other possibilities failed). > > The most convenient to the client is to just add the given log patch to > the pack, restart, collect the relevant logs, and finally revert the log > patch. Any additional steps would be an overhead as the client is already > undergoing a severe issue and client is trying to help us to identify the > issue by applying the log patch. Hence this should be modeled in a > convenient way to the users. > > There is a possibility to let the clients add the log patch into the > [product_home]/lib directory and remove it once done. But with the current > OSGi bundle deployment logic, we can't do that as it always gives the > priority to the bundles in the plugins directory. If we put a bundle with > the same bundle-symbolic-name and version into the plugins directory it > will be ignored. > > To achieve this behavior we have to modify the existing OSGi bundle > deployment logic as follows. > > 1. In the first run make a backup of the original bundles.info file > (bundles.info.original this will be used as the baseline for each time it > updated the bundles.info file) > 2. Read the bundles.info.original file > 3. Add the bundles in the [product_home]/lib directory > 4. Update the bundles.info file > And > The logic in selecting effective bundles list should be changed to not to > give priority to bundles in the plugins directory. Instead modify the > entries, if a similar bundle (symbolic name and version) is found in the > [product_home]/lib > > Above suggested approach allows easily add the patched jars into the > [product_home]/lib directory for temporary purposes. And reverting the > patch is also possible as we have a backup of the original bundles.info > file > > WDYT? > > [1] https://github.com/wso2/carbon-kernel/blob/v5.2.0-m3/lau > ncher/src/main/java/org/wso2/carbon/launcher/extensions/OSG > iLibBundleDeployerUtils.java > > Thanks, > *Jayanga Dissanayake* > Associate Technical Lead > WSO2 Inc. - http://wso2.com/ > lean . enterprise . middleware > email: [email protected] > mobile: +94772207259 <+94%2077%20220%207259> > <http://wso2.com/signature> > -- *Ruwan Abeykoon* *Associate Director/Architect**,* *WSO2, Inc. http://wso2.com <https://wso2.com/signature> * *lean.enterprise.middleware.*
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
