Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Disable p2 garbage collector
Disable p2 garbage collector [message #755812] Wed, 09 November 2011 16:26 Go to next message
Helmut Neubauer is currently offline Helmut NeubauerFriend
Messages: 54
Registered: July 2009
Member
Actually the update process of our RCP client fails due to locked files
of old plugins part of an old feature which isn't part of our software
any more.

So we need to disable the p2 garbage collecor not trying to delete the
locked files. Perhaps you can give us a hint how to do this?

Perhaps it's possible to conrol which files will be deleted and which
not?

Thanks for your help,
Helmut
Re: Disable p2 garbage collector [message #755839 is a reply to message #755812] Wed, 09 November 2011 18:55 Go to previous messageGo to next message
DJ Houghton is currently offline DJ HoughtonFriend
Messages: 28
Registered: July 2009
Junior Member
There is a preference to disable the p2 GC. Try setting this in your defaults when you start your app.

org.eclipse.equinox.p2.garbagecollector/gc_enabled=false

One way to do this is via the command-line and the "-plugincustomization" parameter, pointing to a Properties file with the above contents.
Re: Disable p2 garbage collector [message #755924 is a reply to message #755839] Thu, 10 November 2011 08:34 Go to previous messageGo to next message
Helmut Neubauer is currently offline Helmut NeubauerFriend
Messages: 54
Registered: July 2009
Member
Thanks for your answer! Unfortunately setting the parameter doesn't
solve our problem. Perhaps I didn't understand the whole process
correct.

We are getting following error during the update process:

An error occurred while uninstalling
session context was:(profile=profile,
phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Uninstall, operand=[R]de.test.platformfeature_root.win32.win32.x86 3.5.2.0 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file C:\Programme\test\jre\lib\ext\dnsns.jar failed.
File that was copied to backup could not be deleted: C:\Programme\test
\jre\lib\ext\dnsns.jar

The platform feature actually contains the necessary target files and
our used JRE. We are now trying to replace the feature by two features
splitting the JRE and target files (We would like to use the possibility
of target 3.7.1 to specify the used JRE). So we can easily update one of
the features in future.

Unfortunatelty we can't delete the actually used JRE because of Windows
file locks.

So our idea is to avoid deleting the old JRE during update process.
Disabling the p2 garbage collector seemed to us the right solution. But
the mentioned error still appears.

Perhaps you have an idea, why p2 still tries to delete our file? Or
perhaps an alternative solution for our problem?

If your solution would have worked, we would still have the problem how
to set this preference during the update process.

Thanks, Helmut



Am Mittwoch, den 09.11.2011, 13:55 -0500 schrieb DJ Houghton:
> There is a preference to disable the p2 GC. Try setting this in your defaults when you start your app.
>
> org.eclipse.equinox.p2.garbagecollector/gc_enabled=false
>
> One way to do this is via the command-line and the "-plugincustomization" parameter, pointing to a Properties file with the above contents.
Re: Disable p2 garbage collector [message #757059 is a reply to message #755924] Wed, 16 November 2011 09:51 Go to previous messageGo to next message
Helmut Neubauer is currently offline Helmut NeubauerFriend
Messages: 54
Registered: July 2009
Member
Normally the p2 garbage collector is responsible for deleting old files, isn't it? Perhaps there is another mechanism? Has anyone an idea?
Re: Disable p2 garbage collector [message #757432 is a reply to message #757059] Fri, 18 November 2011 12:39 Go to previous messageGo to next message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 242
Registered: July 2009
Senior Member
I'm not a p2 expert, but I doubt that disabling the garbage collector prevents the uninstall operations from occurring. Unfortunately I don't have any suggestions for workarounds.
Re: Disable p2 garbage collector [message #758023 is a reply to message #757059] Wed, 16 November 2011 11:56 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
The Backup mechanism is used by touchpoints to ensure that deleted and
modified files can be restore to the state before an update started in
case something goes bad and the transaction needs to roll back. I do not
recommend turning it off.

The touchpoint instructions that carry out actions that require backup
are responsible for making calls to the backup service. Hence, if
something is installed with zip action, it will be cleaned up with the
cleanupzip action, and they both handle back up.

In order to skip backing up, you need to modify the p2 instructions for
the thing that can't be updated to simply put it somewhere so it can be
picked up and installed in some later stage.

Someone may have done something smart to handle this scenario, but I am
afraid I don't recall having seen any example how to do this.

What I do know is that on Windows, if a file is really, really locked,
you may have to reboot to get rid of the lock and you may also have to
make special calls to bequest a replace of a file that windows honors
when it boots. (A truly horrible windows construct). This is the reason
on windows you almost always have to reboot when installing and upgrading.

What you could do is to have a separate p2 updater that requires that
the application is closed before updating it. A p2 agent does not have
to update "itself" - i.e. do what the director application does. Maybe
you can do something like this for only the jre part.

Hope that helps in some way.
Regards
- henrik

On 11/16/11 10:51 AM, Helmut Neubauer wrote:
> Normally the p2 garbage collector is responsible for deleting old files,
> isn't it? Perhaps there is another mechanism? Has anyone an idea?
Re: Disable p2 garbage collector [message #758024 is a reply to message #757432] Fri, 18 November 2011 14:11 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
On 11/18/11 1:39 PM, Brian de Alwis wrote:
> I'm not a p2 expert, but I doubt that disabling the garbage collector
> prevents the uninstall operations from occurring.

That is correct. The gc runs much later and removes what was uninstalled :)

- henrik
Previous Topic:Using P2 outside eclipse/rcp application
Next Topic:Update RCP Product Plugin with Bundled JRE
Goto Forum:
  


Current Time: Thu Mar 28 08:42:36 GMT 2024

Powered by FUDForum. Page generated in 0.02530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top