-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[MNG-7615] Multithreaded model builder #893
Conversation
@@ -52,8 +53,8 @@ public DefaultSuperPomProvider(ModelProcessor modelProcessor) { | |||
|
|||
@Override | |||
public Model getSuperModel(String version) { | |||
if (superModel == null) { | |||
String resource = "/org/apache/maven/model/pom-" + version + ".xml"; | |||
return SUPER_MODELS.computeIfAbsent(version, v -> { |
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.
Does this mean that for example maven 4.0.1 could return super POM of Maven 3.8.6 (ie. newer could have all super POMs of older Mavens?)
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.
It could, though the only place it's called is with 4.0.0
afaik, and that's since ages. I found the code does not reflect the javadoc and that the version
parameter is not used, so I fixed it.
If that's not intended, then we should remove the parameter completely.
The version was originally hardcoded, see dd635ca
The commit added a version parameter, but it's only used the first time and subsequent calls return the cached version.
As for having multiple superpoms, I think the problem is that the version has never been updated when the pom changed. So not sure what the future will be for the supermom...
Tried to test drive it, first run on Java 11 was ok, but 2nd run seems deadlocked (console stopped at line 12): |
Deadlock seems consistent, Ctrl-C after 6 minutes previous build, re-run (but this time added |
Those two runs above were Java 11. Switched to Java 17, first run was OK, but then it deadlocked again: |
7d7e278
to
a46f8b3
Compare
So the PR works with 1 one thread here, but may deadlock irrespective on the number of threads. |
afec4a2
to
e0d9d91
Compare
6d9fb28
to
a1d11a0
Compare
b4529bb
to
d6fb14f
Compare
Ran ITs of this PR + resolver 2.0.0 (both combined) and ITs are OK |
7f83f0f
to
f7e4a4c
Compare
JIRA issue: https://issues.apache.org/jira/browse/MNG-7615
Same PR as #803 but reformatted.