-
Notifications
You must be signed in to change notification settings - Fork 31
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
Don't evict the full cache of local repo when m2 repository changes. #494
Conversation
The watcher has the only local repo directory registered, so it may control only the direct children of this directory, not the deeper levels, so it will not be notified if a new version of an existing artifact arrives, or a new group is created inside an already existing one. Currently, after any change in local repo directory (addind/removing a file or directory) Watcher stops working and exits, probably due to an exception happening like the following one:
This exception is quite easy to fix, however to make Watcher to react to an artifact changes (not to the only creation of a new/ modification/removal of an existing group) its needed to register Watcher for ALL the child directories of the local repo directory recursively and watching for all the watch keys created (resetting/cancelling etc) |
2711220
to
9757113
Compare
@vrubezhny I improved the watcher |
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.
Update the comments please
.../java/org/eclipse/lemminx/extensions/maven/searcher/watcher/LocalRepositoryFilesWatcher.java
Show resolved
Hide resolved
.../java/org/eclipse/lemminx/extensions/maven/searcher/watcher/LocalRepositoryFilesWatcher.java
Outdated
Show resolved
Hide resolved
9757113
to
31572e8
Compare
Signed-off-by: azerr <azerr@redhat.com>
31572e8
to
be5493c
Compare
I have asked a question on using this Oracle license: https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/9848 |
be5493c
to
f3c095b
Compare
When looking for a latest artifact versions a "release" version is to be treated as more recent version comparing to an according "snapshot" or a "qualifier" version, e.g:: |
f3c095b
to
d711e22
Compare
d711e22
to
9648edf
Compare
@angelozerr I've made it to correctly react on different kinds of artifacts deletions (permanent & trash) and additions (copy to & building with maven). |
The PR cannot be applied as it generates errors like:
due to exceeding the |
Isn't the issue caused by the watchService not properly disconnecting the watch(key) before plugging a new one? I think this PR has merits and it could be worth keeping it open and trying to make it work. |
@mickaelistria Why is this PR restored? It's outdated and doesn't add any value now.
We don't use WatchService anymore for two reasons:
|
I didn't realize that the WatchService was not looking at folder recursively. In another discussion, @angelozerr made me realize that, and I agree with you both that this PR can be closed. |
It probably will not be useful for updating after a workspace maven project is built, but if it doesn't rely internally on Watch Service API then it worth to use it instead of the current updater thread (that currently monitors the changes "from outside" on Local repository directories for every 30 minutes). I would creating a new issue to track this. |
Created #507 to consider using Apache FileAlterationMonitor |
Don't evict the full cache of local repo when m2 repository changes.