-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way to force an update of cahed p2 repositories when using version ranges in .target files #1514
Comments
I think a method like this in P2Utils called from the appropriate place(s) would do the trick:
Of course the next question is, where are the appropriate places? |
I don’t see relationship between what you show and the calls that flush the in-memory, already-loaded repositories so that they are reloaded from the remote URI. If the already-loaded in-memory repository is reused, it will simply download the older artifacts again. This was annoying behavior with oomph’s tasks, i.e., not actually reading the latest repo content but rather using the state it was in earlier. Only a restart solves that problem, as described in the discussion. |
Your snippet will flush all caches, so if we want something like that I would expect it to be near by the bundle pool preferences with a clean button.
In the context of a target platform it should be enough to flush the cache of the repositories in question when hitting the "Reload" button. This is probably not done as of today, but I don't think we need a new UI for that. |
I would personally hope that when I ask to refresh the target platform that the behavior will not depend on what may or may not already be in memory. I would not expect to hunt for a place in the preferences for a button. So I definitely don’t suggest a new button. If we can’t selectively flush the cache, hit it with a big hammer. Given composite repositories and repositories with references, knowing what to flush selectively is a hard problem, so I propose the big hammer. |
The problem with such thing is that it need to be rolled out and don't help with all setups as there are multiple ways to create a site. In any case, actually we have already such thing (at least for HTTP, FTP would be possible as well) but there is one big provider (if not the biggest one) that explicitly renders this feature useless: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/1039 because of this Tycho even goes further and caches content for 60minutes (but has the Anyways obviously P2 can know that if it works after a restart of eclipse, so I think it is more a matter to bypass the (in memory) cache, that is mainly used to not load a repository more than once in a session. |
As Christoph suggests, there is a local file cache and an in-memory cache. They are two different things. The local file cache's time stamp is compared to the remote timestamp such that it's downloaded again as needed. This generally works well. Sometimes the servers are a little slow (some delay) about actually serving up new content, but that cannot be helped on the client side. It is the reusing of the in-memory repositories, which are of course there to avoid loading the same thing repeatedly, that cause problems, i.e., unexpected, hard-to-reproduce behavior because of course neither the local file cache nor the remote source is consulted.. So I think that operations that explicitly ask for the target platform to be reloaded or re-resolved should just flush the repository manager caches; Oomph targlet resolution and p2 task resolution (and even the repository explorer) do exactly that because one simply expects and wants such behavior. |
I have now created a PR
The problem with what people "wants" is that this often changes, e.g. people also "wants" that target editor load fast... so flushing caches "just in case" will decrease performance for these use-cases. |
The target-editor should load and resolve fast yes and I think that should not be changed. |
The button informs the target location to throw away its state and then resolves the location again, what specifically is performed is dependent on the location implementation. So as mentioned before (and done in the PR) the Location implementation should do something sensible and not "the button". For example consider a |
I have checked the refresh of IU locations and the actually already perform the operation to refresh the repositories, so I don't see much PDE can do here. With in place I therefore closing this, if there are still issues please provide steps how to reproduce the problem. |
Yes, I think we can assume this is working well now. |
Hi,
as discusessed in #1513 , it would be great to be able force an update of p2 repositories (aka. invalidate the cache) to consume eg. updated SNAPSHOT builds.
Currently the only working way seems to restart the complete IDE.
Thanks you.
Bye Peter
The text was updated successfully, but these errors were encountered: