-
Notifications
You must be signed in to change notification settings - Fork 356
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
Fix infinite loop in MavenPomDownloader #4598
Conversation
I think this fix would break projects that use a revision property and where the module structure is more than one level deep. I assume @marcel-gepardec has an example for that. The code wants to traverse to the root-pom, but apparently the condition for reaching the root is not good enough. |
Thanks for the quick work here @philippe-granet ; I'll give @marcel-gepardec a little time to chime in, but ideally we work this in before tomorrow's release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java
- lines 142-142
I also ran into this infinite loop with some local testing :) edit: for more detail, I fell into the infinite loop when some project pom had a dependency whose transitive dependencies led back to the same group-artifact as a project pom, but with a different version. the |
@marcel-gepardec wont be available today before noon CET. Its unlikely that he can provide a fix today especially since the code is really complicated imho. In my opinion the code would need a more in depth rework. |
Thanks for that context @ErhardSiegl ; then I propose we merge the change already, given that the same tests still pass, it fixes an issue for two folks (at least), and might only break when the module structure is deeper. That last case can then be picked up separately with a matching test. A test for the scenarios @philippe-granet & @nmck257 encountered would also be helpful to avoid regressions at that point, but let's not hold up this fix and the release for that. Thanks all! |
well this is odd -- one of the tests from that PR ( I'm on windows; Java URI syntax isn't OS-specific?...
|
@nmck257 @timtebeek I fixed the issue with the infinity loop and the failing test in |
What's changed?
Fix an infinite loop in MavenPomDownloader
What's your motivation?
Since this MR #4472 , there is an infinite loop in
MavenPomDownloader.download()
when root pom have a parent.