Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
Hi Azeez, Sameera, Senaka, In PoC, I could able to get the bundle dependency closure( Bundle which import packages from updated bundle) of updated bundle and refresh it pragmatically. This will solve wiring issue with hot update. According to the offline dicussion had with Senaka, we need to check this with critical bundle as well and check how it works at runtime. Critical bundle in the sense bundle(like carbon core, registry bundles) which export common packages. However we need to design this hot update and hot deployment models ( patching also goes under this) considering all possibilities that can be happened in OSGi runtime. One assumption I made in this PoC is, it is not required to use older objects in runtime once the package is updated. May be that is not always correct. Thanks, Shameera. On Tue, Jan 21, 2014 at 7:53 AM, Afkham Azeez az...@wso2.com wrote: With C5, our dependency on Axis2 will be minimal. Azeez On Mon, Jan 20, 2014 at 7:59 PM, Kasun Gajasinghe kas...@wso2.com wrote: Hi Azeez, I have used the said method of updating a bundle, and it worked for me sometimes. But there can be issues when doing this. One issue I have faced is that, if a bundle contained an admin service, then that service gets re-added during a bundle update. Then, Axis2 started complaining two services cannot have the same name. The said issue won't be there in C5 since we will not be using axis2 based admin services. But there can be other issues like this when the initialization logic happens inside the service component. IMO it's better to do a restart of the server for bundle updates. Thanks, KasunG On Mon, Jan 20, 2014 at 7:42 PM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Software Engineer - WSO2 Inc.* *email: shameera AT wso2.com shame...@wso2.com , shameera AT apache.org shame...@apache.org* *phone: +9471 922 1454 %2B9471%20922%201454* *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561 *Twitter : *https://twitter.com/Shameera_R ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 blog: **http://blog.afkham.org*http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
Hi Azeez, I have used the said method of updating a bundle, and it worked for me sometimes. But there can be issues when doing this. One issue I have faced is that, if a bundle contained an admin service, then that service gets re-added during a bundle update. Then, Axis2 started complaining two services cannot have the same name. The said issue won't be there in C5 since we will not be using axis2 based admin services. But there can be other issues like this when the initialization logic happens inside the service component. IMO it's better to do a restart of the server for bundle updates. Thanks, KasunG On Mon, Jan 20, 2014 at 7:42 PM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
Hi all, Can we try this out for some well known bundles (covering different types) and see whether it works or not? For example, what happens if you use this approach to patch the Registry/UM kernel in Carbon 4.2.x? If it works fine, if not, what are the problems that we need to fix? Then, what happens if you use the same approach for a UI bundle? and so on... Thanks, Senaka. On Mon, Jan 20, 2014 at 10:11 PM, Sameera Jayasoma same...@wso2.com wrote: Hi Azeez, This is the standard way of updating an OSGi bundle using the command line console. It is possible to do updates using OSGi APIs. I guess we need to re-think about our patching strategy. I mean where to place patches etc. Because to update an OSGi bundle, AFAIK you simply have to replace the existing bundle with the new bundle in the filesystem and invoke the update call. This is also related to dynamic bundle loading. So I think we need to design our hot deployment bundle and the patching strategy properly first. Thanks, Sameera. On Mon, Jan 20, 2014 at 6:12 AM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- Sameera Jayasoma, Architect, WSO2, Inc. (http://wso2.com) email: same...@wso2.com blog: http://sameera.adahas.org twitter: https://twitter.com/sameerajayasoma flickr: http://www.flickr.com/photos/sameera-jayasoma/collections Mobile: 0094776364456 Lean . Enterprise . Middleware ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *[image: http://wso2.com] http://wso2.com Senaka Fernando* Senior Technical Lead; WSO2 Inc.; http://wso2.com * Member; Apache Software Foundation; http://apache.org http://apache.orgE-mail: senaka AT wso2.com http://wso2.com**P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818 Linked-In: http://linkedin.com/in/senakafernando http://linkedin.com/in/senakafernando*Lean . Enterprise . Middleware ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
Hi Azeez, As we know in OSGi world we have tow types of dependencies 1) OSGi services, 2) Bundle wiring . updating a bundle with new bundle we can solve OSGi services dependencies correctly but when we come to bundle wiring we need to find out correct dependency closure and refresh that OSGi bundles. If not the bundle which already wired with old bundle will not get wired with the update osgi bundle. Hence we need to carefully thing about this process. Thanks, Shameera. n Mon, Jan 20, 2014 at 7:42 PM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Software Engineer - WSO2 Inc.* *email: shameera AT wso2.com shame...@wso2.com , shameera AT apache.org shame...@apache.org* *phone: +9471 922 1454* *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561 *Twitter : *https://twitter.com/Shameera_R ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
Yes, you have to refresh the dependent bundles. I think we can write our patching logic to figure out the OSGi wiring (using OSGi WireAdmin) and then refresh the dependent bundles. On Mon, Jan 20, 2014 at 11:18 PM, Shameera Rathnayaka shame...@wso2.comwrote: Hi Azeez, As we know in OSGi world we have tow types of dependencies 1) OSGi services, 2) Bundle wiring . updating a bundle with new bundle we can solve OSGi services dependencies correctly but when we come to bundle wiring we need to find out correct dependency closure and refresh that OSGi bundles. If not the bundle which already wired with old bundle will not get wired with the update osgi bundle. Hence we need to carefully thing about this process. Thanks, Shameera. n Mon, Jan 20, 2014 at 7:42 PM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Software Engineer - WSO2 Inc.* *email: shameera AT wso2.com shame...@wso2.com , shameera AT apache.org shame...@apache.org* *phone: +9471 922 1454 %2B9471%20922%201454* *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561 *Twitter : *https://twitter.com/Shameera_R -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 blog: **http://blog.afkham.org*http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
With C5, our dependency on Axis2 will be minimal. Azeez On Mon, Jan 20, 2014 at 7:59 PM, Kasun Gajasinghe kas...@wso2.com wrote: Hi Azeez, I have used the said method of updating a bundle, and it worked for me sometimes. But there can be issues when doing this. One issue I have faced is that, if a bundle contained an admin service, then that service gets re-added during a bundle update. Then, Axis2 started complaining two services cannot have the same name. The said issue won't be there in C5 since we will not be using axis2 based admin services. But there can be other issues like this when the initialization logic happens inside the service component. IMO it's better to do a restart of the server for bundle updates. Thanks, KasunG On Mon, Jan 20, 2014 at 7:42 PM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 blog: **http://blog.afkham.org*http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Proper way of patching an OSGi bundle (without restarting the runtime)?
With regards to patches including config file changes, we should make it possible to hot update config files. Stratos folks are doing this (somewhat) successfully. The partitions, autoscaling policy etc. are hot updated. On Tue, Jan 21, 2014 at 7:52 AM, Afkham Azeez az...@wso2.com wrote: Yes, you have to refresh the dependent bundles. I think we can write our patching logic to figure out the OSGi wiring (using OSGi WireAdmin) and then refresh the dependent bundles. On Mon, Jan 20, 2014 at 11:18 PM, Shameera Rathnayaka shame...@wso2.comwrote: Hi Azeez, As we know in OSGi world we have tow types of dependencies 1) OSGi services, 2) Bundle wiring . updating a bundle with new bundle we can solve OSGi services dependencies correctly but when we come to bundle wiring we need to find out correct dependency closure and refresh that OSGi bundles. If not the bundle which already wired with old bundle will not get wired with the update osgi bundle. Hence we need to carefully thing about this process. Thanks, Shameera. n Mon, Jan 20, 2014 at 7:42 PM, Afkham Azeez az...@wso2.com wrote: Folks, Our patching strategy has been to make an exact copy of the patched jar, and then during startup, do a bundle replacement. With Carbon 5, our aim is to be able to patch bundles without requiring a full restart of the OSGi runtime. I read somewhere that; update bundle id file:patches/new Bundle name is one way of patching a bundle. So say we are patching org.wso2.carbon.core-4.2.0.jar, we could have a patched jar called org.wso2.carbon.core-4.2.0.p0001.jar and then do; update 23 file:patches/p0001/org.wso2.carbon.core-4.2.0.p0001.jar Will this strategy work? -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev -- *Software Engineer - WSO2 Inc.* *email: shameera AT wso2.com shame...@wso2.com , shameera AT apache.org shame...@apache.org* *phone: +9471 922 1454 %2B9471%20922%201454* *Linked in : *http://lk.linkedin.com/pub/shameera-rathnayaka/1a/661/561 *Twitter : *https://twitter.com/Shameera_R -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 %2B94%2077%203320919 blog: * *http://blog.afkham.org* http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* -- *Afkham Azeez* Director of Architecture; WSO2, Inc.; http://wso2.com Member; Apache Software Foundation; http://www.apache.org/ * http://www.apache.org/* *email: **az...@wso2.com* az...@wso2.com * cell: +94 77 3320919 blog: **http://blog.afkham.org*http://blog.afkham.org *twitter: **http://twitter.com/afkham_azeez*http://twitter.com/afkham_azeez * linked-in: **http://lk.linkedin.com/in/afkhamazeez http://lk.linkedin.com/in/afkhamazeez* *Lean . Enterprise . Middleware* ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev