Community
Participate
Working Groups
Hi All, Recently we found an issue that is causing a huge number of entries being logged in the .log file (just a piece of it attached). I was investigating the issue and I have noticed that the problem is related to the way how composer deals with unpacking downloaded archives and how Eclipse reacts on resources that are created outside of workspace. Below is the step by step description of what is going on and why we have such huge amount of DLTK model exceptions being logged. While triggering "Install Dependencies" action (i.e. on Zend Framework project from GitHub) there is a job that runs the appropriate command to install Composer dependencies. When dependencies are installed and there are some archives being fetched, Composer uses \vendor\composer directory as a intermediate directory for unpacking the contents before moving them into appropriate locations. If Eclipse has "Refresh using native hooks or polling" option enabled in preferences, it may trigger the refresh job while composer is having this temporary/unpacked sources in \vendor\composer directory. If aforementioned refresh is performed, resource change notifications are triggered for different source files that are only available for the time of unpacking the archives by composer. Those events are causing i.e. DLTK indexer job to schedule indexing operations for those sources. Eventually, indexing job will start to perfom indexing operations but in the meantime composer finishes unpacking and removes the intermediate directories, in that case DLTK model elements are no longer having the corresponding files available which causes the exceptions to be thrown. Generally I can not find any good solution that will help preventing those Composer intermediate directories/files to be NOT taken into account while refreshing Eclipse workspace and so triggering the resource change events. Using WorkspaceJob instead of Job as a base for ComposerJob class doesn't help as refresh is performed by a separate thread/job that is triggered by the fact of externally added files/folders (we can not take control over it, skip it, block it or just exclude \vendor\composer directory in that process for Composer operation time, etc. etc.). Disabling "Refresh using native hooks or polling" preference in the code for the time of composer operation solves the problem but I think it is not a good solution... The best solution would be to tell Composer to create those intermediate directories outside the workspace project but after taking some closer look at Composer sources it looks like it is not possible (some time ago the TMPDIR env var value was used for that purpose but they changed this behavior due to this bug: https://github.com/composer/composer/issues/1765). So basically I stucked and maybe some of you guys will have any good idea how to solve this issue?
Created attachment 267103 [details] Small chunk of log file
So there is no way to tell the DLTK indexer job to not index some (intermediate) directories? :/
(In reply to Thierry BLIND from comment #2) > So there is no way to tell the DLTK indexer job to not index some > (intermediate) directories? :/ At first glance I can not see anything that may do such thing. Anyway, even if it would be possible to tell indexer to skip some modules then what about other features that might be affect in a very same way?
Did you try eclipse directory filters?
Yes, maybe Resource Filters... Right-click on the php project and choose Properties -> Resource -> Resource Filters.
New Gerrit change created: https://git.eclipse.org/r/92407
Gerrit change https://git.eclipse.org/r/92407 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=521e354d7070ce119601eb7b945512b15af34797
Fixed. Thank you guys for hints!
New Gerrit change created: https://git.eclipse.org/r/92774
Gerrit change https://git.eclipse.org/r/92774 was merged to [master]. Commit: http://git.eclipse.org/c/pdt/org.eclipse.pdt.git/commit/?id=656bd425e676898c4b84d741d0f6b6e73fa5df42
Reverted the previous change as it causes severe side-effects (bug 513432).
New Gerrit change created: https://git.eclipse.org/r/153599