[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] P2 Uninstall/Update IU operations does not work.

On Thu, Mar 22, 2018 at 1:25 PM, Abdallah Salama <abdallah.salama@xxxxxxxxxxxxxxxx> wrote:
- While the product is running (for example our server product which runs using Jetty), we want to delete or update some running (active bundles) but neither delete nor update are working.

After a provision installation, the OSGi runtime isn't updated immediately. For example, the IDE will typically suggest a restart (as some 3rd-party bundles aren't dynamic enough to handle dynamic update). If you want the result of p2 (un)install to take effect immediately without restarting the application, you have to call some p2 code so it updates the content of OSGi instance (and will stop/start/uninstall necessary bundles from Equinox state).
Unfortunately, I don't have a snippet nearby to share with you right now.
- Even after the implementation of the garbage collector and called it explicitly after each each delete operation, the bundle is not deleted. Still i see the bundle active.

I think that's because of what's mentioned above: an extra step is necessary to cascade the provisioning operation from p2 to Equinox.

- As most of our bundles are root IUs. So the UpdateOperation is not working as well, i have read in the eclipse documentation the the IU if it is a root one, then it should be completely uninstalled from the system and installed again if i want to update it, and since the delete (uninstall) does not work so i am struggling with the update as well.

Updating root IUs require updating of the product/running application as a whole. I don't think you can easily apply dynamically changes for root IUs on a running instance without restarting. In general, it's much easier to avoid root IUs if you can. the .product allows to change that trivially with a checkbox IIRC.

1- According to what i have done, is there a missing in the implementation to make the uninstall or delete really working?

I think so (as described in 1st part of my answer)