-
Notifications
You must be signed in to change notification settings - Fork 115
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
M2Eclipse gets stuck in endless update loop #123
Comments
I closed ticket Bug 563140 [1] since no longer reproducible |
Is there any progress on this issue? I run into it in my Tycho-Dev workspace (provisioned using the Tycho Oomph-Setup), using Eclipse-for-Commiter latest (currently at 2021-03) and m2e 1.17.2. I sampled my Dev-Eclipse using VisualVM and from this it looks like the loop is in the LifecycleMappingFactory. |
@HannesWell Good idea. The problem is that this not occurs always, sometimes it helps to update one or two projects. then it works for some time and then comes back. I'm currently also again caught in an endless circle 👎 |
Yes this issue just appeared recently to me. I could make it work once by updating one or two projects as you said. But now this also did not work. It is just terribly annoying, I can hardly change a line of code in my Tycho-Dev workspace. Anyway. I just attached a debugger and my first impression is that the |
ProjectRegistryManager line 504 a new facade is created but I can't tell from the code if this is intentional. |
@mickaelistria can you take a look at this? even worse now my IDE constantly get stuck and I need to kill the process :-( |
One think that might help here: |
Now that I used my Tycho-Dev workspace from an Eclipse instance that is launched (in debug mode) from another Eclipse having the m2e projects in its workspace the endless loop is gone. Even when I use the workspace from the When I just hat the debugger attached I observed that constantly pom-files are added to the
From the relevant code snippet above I concluded that the pom files are only added to the context if But this is the first time I look into the sources of m2e so this might be the wrong path. Similar to @laeubi's suggestion I thought that the DependencyResolutionContext should also hold a second set of already refreshed/handled poms in order to avoid the endless loop. Nevertheless the root cause of the endless loop should be found because it seems to work before/sometime. |
I don't think I'll be available to work on this issue soon (no more school for my kid here, so reduced productivity and another kid to get born sometimes this month making me off from work for one month); but it's definitely something I'm interested in seeing fixed. |
The problem is that the error comes and goes and when its gone there is normally no demand to broke it again ... my hope is, that maybe someone with more knowledge of this resolving stuff can give a hint or has an idea what could be the issue so for example so its easier to try out for people having the issue than starting from scratch. But I can of course understand that this is not a top-issue as long as it is not reproducible. What would be of major interest for me would be: How good is this area covered by unit test? So if I start hacking on his, how big is the chance to break something unintentionally and uncovered? |
Mickeal then all the best for your family. A reproducible case would indeed be a goo thing. I deleted and re-provisioned my tycho-workspace a few days ago because of this problem and run again into the endless loop (I think it was after going back and forth in the git history between and after the 2.3.0 release). So I can try to find steps to reliably reproduce this issue. Regarding cycles in the build path: Sometimes I get problem markers indicating cycles in the build path. The last time the vanished by cleaning and building the entire workspace so maybe this was based on outdated metadata that cause the same problem here. |
For the tycho case I was able to break the cycle by:
|
Below there is an extract from the log, while for some times there are some items different after a while the following entries are repeated over and over again:
I then cancel the job and if I update the 'org.eclipse.tycho:sisu-equinox-api' for example as a singel project it works. After that I got to Maven > update project, deselect all projects and use "add out of date" then everything works fine. So this seems to happen if
|
I now get an error marker: but the tycho-core project has no error markers and I have performed a project->clean all |
This also happens for other projects, interestingly from time to time the maven builder kicks in and begin to build something (without any action that would trigger this, e.g I just switching some editor windows). Now the error marker on org.eclipse.tycho:sisu-equinox-api' is gone but remains on other projects. SO it seems there is something stuck or timmed-waiting in m2e |
We recently experienced such a loop as well.
In eclipse, we have the https://github.com/tesla/m2eclipse-mavenarchiver connector installed, that takes care of generating the manifest in eclipse. So when a project changes, we get the following chain:
The last method So whenver the file gets generated (which triggers a change event leading to the above chain) and the processing takes more than one second (or occurs around the switch to the next second), The fix for us is to add a profile with a maven-archiver configuration that uses a hardcoded, stable timestamp instead of the actual time. We activate this profile only inside m2e.
|
Thanks Carsten. Do you think you could provide a minimal reproducer? Also do you see an opportunity for improvement here in m2e (for example keeping finer grain timestamps in memory and compary per nano or milliseconds instead of seconds to avoid loops, or just replacing some |
I can try to create a reproducer. However I'm not sure how m2e could avoid such a situation. I was mostly trying to document the problem so that others can check their setup for a similuar situation. A greater precision (e.g. ns or ms) would make the problem even worse since the A lower precision (e.g. min) would help a bit, but still would lead to unneeded builds. IMHO, the Manifest should never change in eclipse, as long as the code/metadata for it doesn't change. Because every change triggers a build. I actually need to check the |
is there any progress on the issue? it started suddenly after last "big" eclipse update IIRC and it's basically almost impossible to stop manually... |
This is happening with us after we updated our Eclipse RCP product to Eclipse 4.21. Restarting the IDE seems to help, but is a major inconvenience and makes the software unusable unless this is done. |
Please provide some minimal reproducer (eg minimal project set and steps to reproduce) if you want to see the chances of this being fix increased. |
Hey All, this was troubling me deeply and we had a bug open for this on osgi/osgi-test and we thought it was in our side (perhaps in bndtools). However, I finally tracked it down to a loop between
The problem is the issue with the two different checks for the source artifact: one by m2e code, and the other by maven.resolver that have different ideas about what is out of date which means the download queue is always refilled with the same files over and over and so it just loops. HOWEVER, I was able to trigger the issue at will by changing the timestamp directly on the file system of the source artifacts for any dependency referenced by the build. So, if you really want to eliminate the problem without searching every individual timestamp in your osgi]$ ll --time-style=full-iso org.osgi.test.junit4/1.0.1/
-rw-rw-r-- 1 rotty rotty 16341 2021-08-05 10:34:56.000000000 -0400 org.osgi.test.junit4-1.0.1.jar
-rw-rw-r-- 1 rotty rotty 8078 2021-08-05 10:34:42.000000000 -0400 org.osgi.test.junit4-1.0.1-sources.jar run something like: this will just update the source artifacts to be newer than the main artifacts and then you should be fine. |
I have only checked |
With the latest version I see the following being stuck and running over and over again with different projects but never making any progress: Maybe this gives a hint about what is being the root cause: #619 (comment) |
So this looks like some kind of event flooding. Is the builder triggering async resource changes, which are propagated outside of the builder? |
I'm now having a workspace where the problem occurs and I can debug it from what I see the problem is that there is one parent project that has errors, thus it don't make it into the ProjectRegistry and then if another project tries to fetch that project is is noticed that it is out of date and needs updates, then it is noticed that the project itself has changed and needs an update and so on....
|
In refreshPhase2 there is:
this adds "dependents" pom files to the context, which leads to that the queue never gets empty here... (from what I can see). |
I have a fix for this, just need to think if we maybe can do better than my first simple approach ... |
I can confirm, after getting the stuck again with an older m2e release, that with the new code now it is correctly detected and the cycle is left after one initial improvement of the build cycle. |
That's great news and a good reason to go for M2E 2.0 :) |
Hi guys ... happy new year to all. I just found this issue here ... my eclipse shows similar symptoms. Is it worth to create an issue for that? Would be hard to provide a project to reproduce that because of closed source :( I'm using latest snapshot version of m2e. I was able to stack the hanging process:
PS: even "Cancel" the Updating doesn't do anything ... just (Cancel Requested) :( |
Without any reproducing test-case the only thing you can setup a dev environment and debug it yourself. Alternatively you can contact me to enter a contract for analyze / fix it for you and I can sign a NDA or similar. |
@laeubi is it possible to enable more logging etc ... and how? please give me a hint. I would like to see something like "resolving foobar for plugin blubs" ... somewhere is a endless loop or something. |
You can open the "Maven Console" to get the maven log but I doubt this will give you more insights of the problem. |
I often have a similar problem that it hangs at resolving plugins when importing a new existing maven project into the workspace. After a couple of tries of killing Eclipse and retrying, it usually works. Also, what seems to help me is to disable auto-build before importing the project. IMHO it is very different from the endless build loop that is described in this bug (and which I also had experienced at various points in the past). |
@reckart my current scenario is more about hanging after trigger an update for already imported projects. I have a little feeling that its maybe something deep inside the artifact-resolving specially for "invalid" artifacts, timeouts while talking with nexus etc. Not sure if this is already in the code... but it would be good to have some properties to pimp timeouts etc. to force "hard crashes" here and there to see more clearly where the real cause is. Endless loops and killing eclipse is really ugly. But I imagine its really complex stuff inside m2e :) |
I didn't try it yet, but if you can consistently reproduce the issue, you might try firing up VisualVM and use the CPU sampler to check in which part of the code the hang occurs. |
This bug seems to have returned in 2022-12. In 2022-09 it was fine! |
Reproducerin test-case? |
Wow you are fast. Test case is hard to describe... Only wanted to check whether this is a known issue. Maven console is going wild after
and the process never stops. The project has 33 modules. The info in lower right corner all the time tells you "Updating Maven Project: (XY%)", with percentage changing. You can also see that memory consumption is very high (up to 4G at the moment, will monitor whether it comes to an OOME), but also frequently changing. Maven console is writing tons of lines... and does not stop. |
Ok the more I read the original posted comments and links, the more I seem to have a different issue. I can indeed stop the build process and do not need to kill the Eclipse process. But of couse this does not help me, as my project is not built anymore... Will try deleting and importing cleanly... maybe there was an issue converting the old project config files to the new version... BTW here the build info: Version: 2022-12 (4.26.0) (c) Copyright Eclipse contributors and others 2000, 2022. All rights reserved. Eclipse and the Eclipse logo are trademarks of the Eclipse Foundation, Inc., https://www.eclipse.org/. The Eclipse logo cannot be altered without Eclipses permission. Eclipse logos are provided for use under the Eclipse logo and trademark guidelines, https://www.eclipse.org/logotm/. Oracle and Java are trademarks or registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. This product includes software developed by other open source projects including the Apache Software Foundation, https://www.apache.org/. Lombok v1.18.26 "Envious Ferret" is installed. https://projectlombok.org/_ |
@laeubi Ok meanwhile my MacBook crashed, got obviously too hot with 2 Eclipse instance endlessly trying to build (tried 2 different project versions in order to exclude issues with our own code - but at least 1 of them was completely developed on the old 2022-09). Additionally I noticed some increased memory consumption, which rose up until 5.5G before I stopped it. Also I missed that indeed the Eclipse instances do not exit on closing them, in case a Maven build is running and although I pressed the red square button, and indeed need to be killed. However, I have a suspicion... Upgraded lombok agent a few days ago, will downgrade again and retest - although I already worked with that setup for a few days, very weird... Oh MacOS even created a nice crash report... Rolled back to 2022-09 from a Time Machine backup and the issue is gone. Will wait for 2023-03 and retry... |
Hi! After I still had the same issues with our project with updates from 2022-09 to or even fresh installations of Eclipse 2024-03 with m2e core 2.6.0, I stumbled over these m2e release notes, allowing to disable automatic builds for single projects:
However, this option is also available as global Maven settings in Eclipse preferences. After disabling it globally, the endless loop Maven build issue is gone :-) Most probably I will have to manually update the Maven project in Eclipse now after pom.xml changes, but at least we can upgrade our project to Java 21 now (which was not supported by 2022-09). Just wanted to share... |
Thanks for sharing. I had this issue and tested everything except this setting... Still don't get the point of having automatic stuff that needs to be deacivated... >_> |
This has been reported in the following Bugs but its unclear how to reproduce this yet:
The text was updated successfully, but these errors were encountered: