Closed BrianSetz closed 4 weeks ago
/cc @geoand (kotlin), @glefloch, @quarkusio/devtools
Upon further inspection, it is not only composite builds that fail.
@dmlloyd ideas^^
Okay, I was able to trace the problem to this commit here: https://github.com/quarkusio/quarkus/commit/fe3d00d428bd075c3726fa3ee0fac64ea3b22636 reverting this resolves the concurrent modification issue
Edit: Interestingly this only seems to manifest within IntelliJ
Looks like the problem is pretty straightforward, thanks to @BrianSetz's analysis. We appear to modify the dependency set while IntelliJ is iterating it from another thread.
That said, I'm not sure what the fix would be. Maybe there's some more well-defined place where we can be doing our modifications? @aloubyansky any thoughts?
The commit fe3d00d428bd075c3726fa3ee0fac64ea3b22636 is also the one causing #41729 in the end this is same root cause.
The import issue is actually challenging. I realize we are registering these "conditional configurations" later than we are probably meant to but I am not sure what other option we have. The reason for https://github.com/quarkusio/quarkus/commit/fe3d00d428bd075c3726fa3ee0fac64ea3b22636 was https://github.com/gradle/gradle/issues/6881
Is there any path to solving this issue? We are also having issues with this.
Yes, investigating and evaluating options currently.
@LarsSven could you please confirm the issue is limited to an IDE import in your case as well? Thanks.
On import and "Reload all gradle projects" action (on my side)
Great to hear its being investigated!
I can confirm the same behaviour as @ylemoigne mentioned, on both Windows and Linux IntelliJ IDEA environments. Running outside IntelliJ IDEA (gradlew
) does not exhibit this behaviour.
@LarsSven could you please confirm the issue is limited to an IDE import in your case as well? Thanks.
Yes it is limited to IDE import
What is the recommendation for Quarkus Gradle + IntelliJ users? Should we remain on 3.12.0? Or is it safe to upgrade anyway? Should https://github.com/quarkusio/quarkus/commit/fe3d00d428bd075c3726fa3ee0fac64ea3b22636 be reverted? Or is there another solution on the horizon?
It should be safe to upgrade, AFAICT. There is a possibility we'll get some perspective on this from the Gradle team. I am reluctant to revert the commit that caused this issue because that will re-introduce another issue related to ignoring enforcing platform constraints on certain dependencies. So far it looks to me as either we have this issue or the other one unless https://github.com/gradle/gradle/issues/6881 gets fixed or there is an alternative I am not aware of at this moment.
@aloubyansky This is crippling for Kotlin projects in IntelliJ/IDEA. The failed import means Kotlin isn't ever configured and is basically unusable. Manually setting up Kotlin isn't workable either as it's blown out when the project is updated or even re-opened.
An interesting point about the failure is that it seems to happen only when the quarkus-kotlin
extension is added.
@kdubb thanks for more info, just to be sure, is it also a consequence of the concurrent modification exception reported above?
Yes, it's a similar ConcurrentModificationException.
If I remove the quarkus-kotlin
extension, the import proceeds successfully; of course these are required for Kotlin in Quarkus.
Sorry for all the issues this is causing. This is being looked into. I'll update this issue as soon as we arrive to a conclusion.
The concurrent exception also appears when using the gradle plugin https://github.com/Splitties/refreshVersions. I created a reproducer quarkus-bug-refreshversions if it helps.
I've been using Quarkus 3.12.1 and later for about a month now, but didn't notice any issues until upgrading to IntelliJ 2024.2, which was released yesterday. Now there are annoying "Kotlin not configured" warning banners over every Kotlin file in my Quarkus project, which disappear when downgrading Quarkus to 3.12.0.
Despite those warning banners, everything seems to work normally so far.
I guess, just bumping the Quarkus version in gradle.properties
and clicking "Load Gradle changes" doesn't do as much as a full Gradle import after an update.
By the way, IntelliJ releases were on June 21 (2024.1.4), August 6 (2024.1.5), and August 7 (2024.2). Quarkus 3.12.1 was announced on July 3. So, many users might just have become affected with a delay of a month and blame it on IntelliJ - maybe rightfully, I don't know. An issue for IntelliJ is here.
The problem existed in both versions for me. I had the problem with 2024.1.x
and upgraded to 2024.2 EAP
to see if it fixed it.
Yes, I'm pretty sure I would have had the problem with 2024.1.x, too, if I had done a full Gradle import/sync for some reason, or created a new project. Just clicking on the "Load Gradle changes" action that pops up in the editor after editing Gradle-related files doesn't seem to be enough to trigger the issue for existing projects, as long as they have been fully imported before Quarkus 3.12.1 with the same IntelliJ version.
Interesting... so if we drop to 3.12.0
do a full import, switch to 3.13.0
, and use the pop-up button and not the full import, it might be a workaround.
Good question... I tried, and figured... uhm... no. Then I downgraded to 2014.1.5 (which I had upgraded to, but haven't really used, shouldn't make a difference, though) - no issues at all. I could switch between Quarkus 3.12.0 and 3.13.1 with "Invalidate caches and restart" in between - no "Kotlin not configured banner". I apologize for jumping to premature conclusions.
However, with IntelliJ 2024.2, before downgrading and after upgrading again: "Kotlin not configured" with Quarkus 3.12.1 and later, but not with 3.12.0.
The release announcement for IntelliJ 2024.2 mentions as key highlight:
We’ve streamlined the startup experience by making the IDE functional with incomplete project models and enabling access to its key features during indexing, allowing you to dive into coding faster.
Maybe that's the crux of the matter.
I'll revert the change that introduced this issue in the upcoming 3.14 release. The impact of the issue it introduced seems to be bigger than the one it fixed.
Describe the bug
When building a composite Gradle project, a
java.util.ConcurrentModificationException
is thrown. I was able to trace the problem to this commit here: https://github.com/quarkusio/quarkus/commit/fe3d00d428bd075c3726fa3ee0fac64ea3b22636 reverting this resolves the concurrent modification issue.Expected behavior
No ConcurrentModificationException, as was the case pre 3.12.1.
Actual behavior
How to Reproduce?
Reproducer: https://github.com/BrianSetz/quarkus-gradle-plugin-reproducer
Simply importing the project into IntelliJ causes the error to show.
Output of
uname -a
orver
Win11
Output of
java -version
java version "17.0.9" 2023-10-17 LTS
Quarkus version or git rev
3.12.1 / 3.12.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.8
Additional information
ConcurrentModificationException
also shows up in https://github.com/quarkusio/quarkus/issues/41729 but does not seem to be connected to theTreeMap
.