Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 288755 - [reconciler] P2 doesn't notice all changes to the *.link files
Summary: [reconciler] P2 doesn't notice all changes to the *.link files
Status: CLOSED DUPLICATE of bug 269297
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 310654 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-07 10:32 EDT by James Blackburn CLA
Modified: 2010-08-25 16:19 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2009-09-07 10:32:07 EDT
I create a *.link file in my dropins / links directory which has a path to another eclipse config which has a single additional feature installed(using the mechanism suggested by Michael Scharf: http://michaelscharf.blogspot.com/2009/02/p2-how-i-install-plugins-in-extension.html).

However if I change the .link file (e.g. by deleting the path=... string) on reloading the IDE, the features are still installed. If I start with the link invalid, and update the path=... link to be valid this is correctly picked up.

If I delete the .link file the installed feature correctly disappear.

In some instances it looks like p2 doesn't notice changes to a .link file.


Steps to reproduce:

1 Create an eclipse configuration with some features:
/path/to/features/eclipse/config

2 touch /home/jamesb/.eclipse/3.5-ccrc2/eclipse/.eclipseextension

3 From a different config create a broken link file:
/path/to/features2/eclipse/dropins/features.link => #path=/path/to/features/

4 Run eclipse with the new configuration and verify that the features aren't picked up.

5 Fix the link: (Remove the leading #)

6 restart the eclipse session and verify that the features are installed

7 corrupt the link path and restart => feature still installed

8 delete the link file and restart => feature removed (as expected)
Comment 1 Martin Oberhuber CLA 2010-03-12 06:36:38 EST
Only directory timestamps are currently watched when checking whether the reconcile cache is up-to-date, that's why changes to a link file won't be noticed.

The code is in 
  org.eclipse.equinox.p2.reconciler.dropins/Activator.java#isUpToDate()

if anybody wants to try a patch. From my point of view, also checking the timestamps of files shouldn't be any more difficult and shouldn't impose a performance hit sine the directory block needs to be read from disk anyways.
Comment 2 DJ Houghton CLA 2010-03-12 09:10:15 EST
This might be a dup of bug 269297.
Comment 3 James Blackburn CLA 2010-03-12 09:26:58 EST
(In reply to comment #2)
> This might be a dup of bug 269297.

Looks like it, however your comment there states:

> Note that this works ok if the link file is in the /links folder but not when
> it is a child in the dropins. The ProfileSynchronizer#isUpToDate check is
> returning true and we aren't detecting the changes.
>
> So the work-around for your specific problems would be:
> - move your link file to the links/ folder

Isn't the links folder was deprecated in place of dropins...:
http://wiki.eclipse.org/Equinox_p2_Getting_Started#Links_Folder

> - or specify the osgi.checkConfiguration=true System property which always does
> a check. (expect slower startup times)

I don't want this either. I promise not to change the contents of my centrally installed features.  I only want the reconciler to run when the link itself has changed, not on every startup. (This could be as simple as checking mtime -- I'm not that fussy :)).

As it happens I already use the workaround of use a different link file, so I'm reasonably happy.
Comment 4 Pascal Rapicault CLA 2010-04-30 09:16:05 EDT
*** Bug 310654 has been marked as a duplicate of this bug. ***
Comment 5 DJ Houghton CLA 2010-08-25 16:19:50 EDT
As part of the fix for bug 269297 I released code which opens the link file and caches the timestamp of the folders that it points to. This is the part which existed in the links/ folder support before but not the dropins/ folder... the old code only used to do a shallow caching.

*** This bug has been marked as a duplicate of bug 269297 ***