Hi Andreas, I think what you're seeing is correct... the index is kept open until eclipse is closed.
I just took a look at it and this shouldn't really be needed. I've just updated things ( https://github.com/fabioz/Pydev/commit/16a355fc82496bc2ec04fa5209d78e11c73b6397) so that it always closes it after using (I did some profiles here and the performance change was negligible in my use-cases, but it may be interesting if someone else could take a look at the timings before/after with some really big projects to see if something changed on some other scenario). Best Regards, Fabio On Fri, Oct 11, 2019 at 9:21 AM Andreas Pakulat <andr...@froglogic.com> wrote: > Hi, > > before setting up a bug tracker account I wanted to confirm that it's not > just me seeing this as a problem. > > It appears that the usage of the lucene indexer for things like 'find > occurrences' breaks the deletion of the project. The reproduction steps > are > rather simple: Create a project, create a module, add a variable with at > least one usage and then use find-occurrences. Finally delete the project > - > including contents - from disk. > > This runs into an exception for me when Eclipse tries to delete metadata > from > the project, particularly in the metadata of the > org.eclipse.core.resources > plugin (.projects/foo/com.python.pydev.analysis). It appears the Lucene > indexer files are causing this as creating a new project with the same > name > and trying a find occurrence in that new project the Lucene indexer > complains > about the write.lock file not being usable. I also find that directory > left > over after deletion of the project while all other files and directories > in > .project/foo are gone. > > This problem only appears on Windows which suggests that Lucene might be > doing something to lock its files with the filesystem so they cannot be > deleted. I could somewhat confirm this theory by manually trying to delete > the folder via Windows explorer after using find-occurrences, this was > forbidden. > > Finally switching the AbstractAdditionalDependencyInfo class to use the > deprecated ReferenceSearches instead of the ReferenceSearchesLucene class > for > search makes the problem go away completely. > > I had a short look at the IndexApi class which uses Lucene and couldn't > help > but wonder if it's really necessary to keep a 'Writer' object open and > running the whole time Eclipse is running. I would've expected the writer > object to be short-lived - for updating the index - and a reader object > possibly being open all the time for reading the stored data. > > Andreas > > -- > Andreas Pakulat squ...@froglogic.com > froglogic GmbH - Automated UI and Web Testing > > > _______________________________________________ > pydev-code mailing list > pydev-code@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pydev-code >
_______________________________________________ pydev-code mailing list pydev-code@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pydev-code