Skip to content
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

Fixed updating the Local Repository caches #502

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

vrubezhny
Copy link
Contributor

Local Repository caches are made to be updated:

  • (only temporary lemminx-maven build repository) when a MavenProject is built and cached
  • (all cached) every 30 minutes

Also, Diagnostic is made to be re-calculated on finishing of Maven Lemminx Extension initialization

Local Repository caches are made to be updated:

- (only temporary lemminx-maven build repository) when a MavenProject is built and cached
- (all cached) every 30 minutes

Also, Diagnostic is made to be re-calculated on finishing of Maven Lemminx Extension initialization
@vrubezhny vrubezhny changed the title Fixed updating thr Local Repository caches Fixed updating the Local Repository caches Aug 14, 2023
@vrubezhny vrubezhny self-assigned this Aug 14, 2023
@vrubezhny vrubezhny merged commit 83b1417 into eclipse:master Aug 14, 2023
5 checks passed
@mickaelistria
Copy link
Contributor

Wasn't the local repository searcher already placing a file listener to properly update its cache whenever something changes?

@angelozerr
Copy link
Contributor

@mickaelistria we removed the thread wich created a watchservice which updated the cache because the original code tracked only the root .m2/repository. I have fixed that to create a watchservice for children folders but we had a problem which created too many watchservice. To avoid this problem we removed this watchservice.

@mickaelistria
Copy link
Contributor

OK, got it. And what is used now to detect new content in the Maven repo? I just read about FileAlterationMonitor ( https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/monitor/FileAlterationObserver.html ), would it be capable of being notified recursively?

@angelozerr
Copy link
Contributor

For the moment we have no find a solution to evict the cache.

Just for your information we have 2 local repo now. The user local repo which is not polluated when user is typing in the editor and à .lemminx-maven repo which is polluated

@mickaelistria
Copy link
Contributor

For the moment we have no find a solution to evict the cache.

OK, please make sure there is an issue, and ideally a test case to demo it, tracking it. This can be an important feature (although not a regression).

Just for your information we have 2 local repo now. The user local repo which is not polluated when user is typing in the editor and à .lemminx-maven repo which is polluated

OK, sounds good.

@angelozerr
Copy link
Contributor

angelozerr commented Aug 17, 2023

If it is based on watchservice we will have the same problem, because in short watchservice must never used with a lot of directories

One idea that we had with @vrubezhny is to provide a thread which evicts the cache per 1 hour

@mickaelistria
Copy link
Contributor

FileAlterationMonitor does some polling with a given interval. It can be once per hour or every 3 minutes. Polling a file system isn't too heavy.

@mickaelistria
Copy link
Contributor

@angelozerr
Copy link
Contributor

angelozerr commented Aug 17, 2023

We need indeed try it. Thanks @mickaelistria for your suggestion!

@vrubezhny
Copy link
Contributor Author

I have created #507 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants