You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Loop between "Building" and "Downloading Sources and Javadoc" #252
While I'm coding for Tycho, on snapshot branch, I see a lot of CPU used by Eclipse IDE and the Progress view seems to loop between "Building" and "Downloading Sources and Javadoc" pretty often.
Reacted by Richard Eckart de Castilho, Raffaele Gambelli, Alex "Blex" B, Younghwan Kim, Markus Ofterdinger and Emil Sierżęga
That typically happens when having some Tycho modules (incl tycho-core and most of content of tycho-bundles) open, but not all, and opening a new module.
Happens for me a lot as well after updating to m2e 1.18.1 - different workspaces, some with Maven modules that are bundles, some only containing regular JAR/WAR/POM Maven modules.
I have installed m2e - Maven Integration for Eclipse (includes Incubating components) 1.18.2.20210721-064 - loops are still there. The funny thing is that "Download Artifact Sources" and "Download Artifact JavaDoc" are even both turned off in the preferences. "automatically update configuration" is also off. Still it loops on "Download sources and javadoc" <-> "Building" until I manually break the loop by killing the "Download sources and javadoc" task.
m2e - Maven Integration for Eclipse (includes Incubating components) 1.18.2.20210721-0646 fixed the endless building/downloading sources for my maven projects
I think the actual cause of this problem is that after the sources/javadoc of a project were downloaded that classpath is updated and during the classpath update a download of the attached sources/javadoc is triggered again.
The following stack-trace illustrates this (a BuildPathManager references its DownloadSourcesJob and vice-versa).
While Mickaels change fixed the problem for the most cases the logic in BuildPathManager.configureAttachedSourcesAndJavadoc leads to an endless loop in case for a SNAPSHOT version of a maven artifact the sources were last-modified before the main-artifact (don't ask me how this happened in my local Maven repo, but it happened).
So in my case the DownloadSources-job runs forever every second and sleeps in between. But I think this can be fixed easily if a job maintains a Set of DownloadRequest of the current run and checks if a request about to be added to the queue is in that set.
This way we should be safe in all circumstances.
I run into this issue a lot during my work. It mostly happens when I'm working on projects of one big maven project with around 300 modules. I only import the few projects I need and sometimes this whole loop starts. The Maven Workspace Build view only showed one projects which was rebuilding over and over. Is there a way I can provide information for solving this issue?
for a list of useful information in such case, "one big maven project with around 300 modules" is very hard to investigate on :-)
Of course you should make sure to use the latest m2e release and maybe can extract some information from the mentioned view what is triggering the rebuild.
I have one of these large projects (actual several) and while I do not have the infinite build problem right now (I have it sometimes), I can see that the parent module (type pom) of which all other modules are submodules has a very high build count. Opening it, I see that its delta section includes basically all the files from the target folders of submodules. Does that make sense? I mean, if a file is already triggering a delta build of a submodule, should it also trigger a delta build of higher-level reactor modules?
It depends on the delta, basically m2e assumes that if the parent changes there is a high chance that childs are affected (otherwise one won't reference it as a parent), since the last release m2e has some improvements to not build unnecessarily, but this might need still improvements.
You say if the parent changes, the child needs to be build - that sounds correct.
But if I read the view correctly, then the parent is built because files in the target folders of its submodules change - that seems odd. Maybe I am readying the view wrong - I assume the files listed under the delta section are the triggers for the build and not the files updated by the build.
Yes these are triggers for a build, but due to the eclipse resource-model m2e will receive deltas for all child items of the parent project so you will see a long list here, but this should not trigger the build as m2e ignores such deltas here if the occur in a submodule:
if you can't share your project here, the best bet is to start Eclipse with remote debugging enabled (via eclipse.ini) and then attach a debugger from another instance (you don't need a full m2e workspace for that, just the sources of interest and even those not need to compile for debugging). As said the feature is quite new and there might be cases where it still fails to detect, also the test coverage is very low in the area of "rebuilds", so adding test-cases for an identified issue would be great as well.
Sorry for using this as a support/feature request thread... but is there some way of seeing through which way a file was scheduled as a delta trigger? For example, I have some files here in src/main/resources appearing in the delta section, But these particular files should be static (i.e. they should not be touched/written to in any way during builds). Yet they have an increased count in the build # column - which I interpret as them having triggered as many incremental builds - which seems very strange if they are static.
As said the feature is quite new and there might be cases where it still fails to detect, also the test coverage is very low in the area of "rebuilds", so adding test-cases for an identified issue would be great as well.
I'll update my m2e to the lastest version before making any further observations... what I am seeing now is old behavior.
After upgrading to m2e 2.3.0, numbers in the build view look considerably more sane. Although in many cases, I now see entries that have neither delta nor execution children - so it is unclear what triggered those builds.
... it also seems that many builds are not recorded anymore at all ... E.g. I see builds happing via the progress view, but they do not seem to be added to the Maven Workspace Build view.
Ok, but I clearly can see "Invoking Maven Project Builder" flashing through rapidly in the progress view but the "Maven Workspace Build" view does not seem to be updated accordingly.
For me the "Maven Workspace Build" doesn't show anything. The loop in the "Progress" view is:
(m2) Download sources and javadoc...
Associate javadoc and sources with classpath - <project 1-n>
Then a few
JPA Project Change Event Handler (Waiting) ...
then
Building <project x>
And then it starts over with downloading Javadoc & Sources.
It loops pretty fast, is there a log of the progress available?
If I disable "Build automatically" the "Building" step is gone, but it loops between "Download sources and javadoc" and "JPA Project Change Event Handler".
Activity
mickaelistria commentedon Jun 28, 2021
It might just be a symptom of #123
laeubi commentedon Jun 28, 2021
Yep that seems to be a reincarnation of that bug. As mentioned there, it some time magically 'happens' but goes away without a clear indication why.
mickaelistria commentedon Jun 30, 2021
That typically happens when having some Tycho modules (incl tycho-core and most of content of tycho-bundles) open, but not all, and opening a new module.
reckart commentedon Jul 12, 2021
Happens for me a lot as well after updating to m2e 1.18.1 - different workspaces, some with Maven modules that are bundles, some only containing regular JAR/WAR/POM Maven modules.
reckart commentedon Jul 22, 2021
Downgrading to m2e 0.17.2 seems to fix the issue.
mickaelistria commentedon Jul 22, 2021
I merged a patch that may improve things yesterday. Maybe it's also worth trying the latest snapshot of 1.18.2.
reckart commentedon Jul 22, 2021
Do you have the update site URL handy?
mickaelistria commentedon Jul 22, 2021
See https://github.com/eclipse-m2e/m2e-core/blob/master/CONTRIBUTING.md#-trying-latest-builds
reckart commentedon Jul 22, 2021
I have installed
m2e - Maven Integration for Eclipse (includes Incubating components) 1.18.2.20210721-064- loops are still there. The funny thing is that "Download Artifact Sources" and "Download Artifact JavaDoc" are even both turned off in the preferences. "automatically update configuration" is also off. Still it loops on "Download sources and javadoc" <-> "Building" until I manually break the loop by killing the "Download sources and javadoc" task.mickaelistria commentedon Jul 22, 2021
@reckart thanks for trying. Do you have a minimal project that can reproduce this issue in a predictable manner?
reckart commentedon Jul 22, 2021
Unfortunately not.
a1dutch commentedon Jul 22, 2021
m2e - Maven Integration for Eclipse (includes Incubating components) 1.18.2.20210721-0646fixed the endless building/downloading sources for my maven projectsciros88 commentedon Jul 28, 2021
I confirm build 1.18.2.20210721-0646 fixed that annoying problem
HannesWell commentedon Aug 21, 2021
I think the actual cause of this problem is that after the sources/javadoc of a project were downloaded that classpath is updated and during the classpath update a download of the attached sources/javadoc is triggered again.
The following stack-trace illustrates this (a
BuildPathManagerreferences itsDownloadSourcesJoband vice-versa).While Mickaels change fixed the problem for the most cases the logic in
BuildPathManager.configureAttachedSourcesAndJavadocleads to an endless loop in case for a SNAPSHOT version of a maven artifact the sources were last-modified before the main-artifact (don't ask me how this happened in my local Maven repo, but it happened).So in my case the DownloadSources-job runs forever every second and sleeps in between. But I think this can be fixed easily if a job maintains a Set of DownloadRequest of the current run and checks if a request about to be added to the queue is in that set.
This way we should be safe in all circumstances.
I'm about to prepare a PR for this.
Prevent endless download of artifact sources/javadoc (eclipse-m2e#252)
38 remaining items
AndreasFagschlunger commentedon Jul 19, 2023
I run into this issue a lot during my work. It mostly happens when I'm working on projects of one big maven project with around 300 modules. I only import the few projects I need and sometimes this whole loop starts. The
Maven Workspace Buildview only showed one projects which was rebuilding over and over. Is there a way I can provide information for solving this issue?laeubi commentedon Jul 19, 2023
See
for a list of useful information in such case, "one big maven project with around 300 modules" is very hard to investigate on :-)
Of course you should make sure to use the latest m2e release and maybe can extract some information from the mentioned view what is triggering the rebuild.
reckart commentedon Jul 19, 2023
I have one of these large projects (actual several) and while I do not have the infinite build problem right now (I have it sometimes), I can see that the parent module (type pom) of which all other modules are submodules has a very high build count. Opening it, I see that its delta section includes basically all the files from the target folders of submodules. Does that make sense? I mean, if a file is already triggering a delta build of a submodule, should it also trigger a delta build of higher-level reactor modules?
laeubi commentedon Jul 19, 2023
It depends on the delta, basically m2e assumes that if the parent changes there is a high chance that childs are affected (otherwise one won't reference it as a parent), since the last release m2e has some improvements to not build unnecessarily, but this might need still improvements.
reckart commentedon Jul 19, 2023
You say if the parent changes, the child needs to be build - that sounds correct.
But if I read the view correctly, then the parent is built because files in the target folders of its submodules change - that seems odd. Maybe I am readying the view wrong - I assume the files listed under the delta section are the triggers for the build and not the files updated by the build.
laeubi commentedon Jul 19, 2023
Yes these are triggers for a build, but due to the eclipse resource-model m2e will receive deltas for all child items of the parent project so you will see a long list here, but this should not trigger the build as m2e ignores such deltas here if the occur in a submodule:
m2e-core/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/builder/MavenBuilderImpl.java
Line 185 in 8c838c8
if you can't share your project here, the best bet is to start Eclipse with remote debugging enabled (via
eclipse.ini) and then attach a debugger from another instance (you don't need a full m2e workspace for that, just the sources of interest and even those not need to compile for debugging). As said the feature is quite new and there might be cases where it still fails to detect, also the test coverage is very low in the area of "rebuilds", so adding test-cases for an identified issue would be great as well.reckart commentedon Jul 19, 2023
Sorry for using this as a support/feature request thread... but is there some way of seeing through which way a file was scheduled as a delta trigger? For example, I have some files here in
src/main/resourcesappearing in the delta section, But these particular files should be static (i.e. they should not be touched/written to in any way during builds). Yet they have an increased count in thebuild #column - which I interpret as them having triggered as many incremental builds - which seems very strange if they are static.laeubi commentedon Jul 19, 2023
Not really, depending on your OS you might want to use native tools to watch this particular file (e.g. inotify https://serverfault.com/a/780522 ), basically if the file is touched (even if content stays the same) it is assumed as a delta.
reckart commentedon Jul 19, 2023
I'll update my m2e to the lastest version before making any further observations... what I am seeing now is old behavior.
laeubi commentedon Jul 19, 2023
By the way, there is one bug in resource plugin itself that make things a bit more worse but it has not gotten much attention yet:
reckart commentedon Jul 19, 2023
After upgrading to m2e 2.3.0, numbers in the build view look considerably more sane. Although in many cases, I now see entries that have neither delta nor execution children - so it is unclear what triggered those builds.
reckart commentedon Jul 19, 2023
... it also seems that many builds are not recorded anymore at all ... E.g. I see builds happing via the progress view, but they do not seem to be added to the Maven Workspace Build view.
laeubi commentedon Jul 19, 2023
"build" is not a exclusive m2e term, it could be anything, including java source compiles, verification and so on...
reckart commentedon Jul 19, 2023
Ok, but I clearly can see "Invoking Maven Project Builder" flashing through rapidly in the progress view but the "Maven Workspace Build" view does not seem to be updated accordingly.
AndreasFagschlunger commentedon Jul 21, 2023
For me the "Maven Workspace Build" doesn't show anything. The loop in the "Progress" view is:
Then a few
then
And then it starts over with downloading Javadoc & Sources.
It loops pretty fast, is there a log of the progress available?
If I disable "Build automatically" the "Building" step is gone, but it loops between "Download sources and javadoc" and "JPA Project Change Event Handler".