-
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
Refresh all repositories when performing an update of IU container #1517
Refresh all repositories when performing an update of IU container #1517
Conversation
3aabb88
to
af1185d
Compare
Test Results 285 files 285 suites 48m 59s ⏱️ Results for commit aa6196f. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this logic assumes that metadata repositories and artifact repositories are always colocated. While I can respect and appreciate that one is carefully trying to update/refresh only the relevant repositories I have a bad feeling that things will be missed. E.g., when a composite is loaded, that can load a whole whack of children and any of those children my need to be refreshed, and so on recursively. Does this logic really do that? (I don't see that it does, but maybe I miss something.)
In any case, would not a flushCache be far simpler and accomplish the same thing (yes perhaps flushing more than necessary, but also not missing anything) without assuming the colocation of metadata and artifact?
Target locations always assume that, I'm not aware one is able to specify different ones (and have never really seen this), also PDE assume this on multiple places.
The logic asks the repository manager to update all repositories (maybe referenced ones too) to refresh, if that "do not work" then this has to be considered at P2/Manger level and not at PDE/Client side.
So either we should drop the caching at all or do it selectively, it does not make sense to cache something when on the other hand one then needs hacks to flush the cache unconditionally.
If I look at the source I see this:
so composites are refreshed recursively already |
If a composites refresh recursively then that's a good thing! I think non-collocated metadata and artifact data is rare enough we could just ignore that detail. So this approach looks reasonable. |
b20a951
to
e7e49a6
Compare
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/P2TargetUtils.java
Outdated
Show resolved
Hide resolved
ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/Messages.properties
Outdated
Show resolved
Hide resolved
Currently the IUBundleContainer#update only queries the current P2 metadata that might be cached. This can lead to situations where when a repository has "just changed" it does not see the latest metadata. As we can assume that if the user mind to hit the update button it is meant to really get the latest, this now ask the manager to update the metadata (and possibly colocated artifacts) repository.
e7e49a6
to
aa6196f
Compare
If no one objects I want to merge this so we have enough time for finding any issues and base further changes on top of this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it.
Currently the IUBundleContainer#update only queries the current P2 metadata that might be cached. This can lead to situations where when a repository has "just changed" it does not see the latest metadata.
As we can assume that if the user mind to hit the update button it is meant to really get the latest, this now ask the manager to update the metadata (and possibly colocated artifacts) repository.
FYI @merks @HannesWell @phermsdorf (and @vogella as always being interested in target editor).
This currently handle the case where one press the
Update
button (to set all IUs to latest version) and something similar will be needed forRefresh
, I'll provide a PR once this is finished to not cause any conflicts.Just in case we still see issues, we need to change/fix P2, as PDE now explicitly express its intend to refresh the data I would expects the manager to take whatever actions are required.