-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix two class loader-related leaks, one in Jackson, the other in QuarkusClassLoader #51712
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
Conversation
I will have to add some recording and I don't think creating one more specialized Recorder is the way to go. Also added the phase annotations for documentation.
This will cause class loader leaks in test and dev mode, otherwise. Fixes quarkusio#51688
When we reset the class loader with the new transformed classes, we need to make sure we drop the element from the protectionDomains, otherwise the MemoryClassPathElement is kept as a key and leaks to the next test/dev mode runs. Fixes quarkusio#51688
| // we don't want the previous MemoryClassPathElement to leak as a key of protectionDomains | ||
| protectionDomains.remove(this.transformedClasses); |
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.
Not the first we've run into this...
geoand
left a comment
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.
Great work on this!!!
...jects/bootstrap/core/src/main/java/io/quarkus/bootstrap/classloading/QuarkusClassLoader.java
Show resolved
Hide resolved
gastaldi
left a comment
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.
LGTM
Status for workflow
|
| Status | Name | Step | Failures | Logs | Raw logs | Build scan |
|---|---|---|---|---|---|---|
| ✔️ | JVM Tests - JDK 17 | Logs | Raw logs | 🔍 | ||
| ✔️ | JVM Tests - JDK 21 | Logs | Raw logs | 🔍 | ||
| ❌ | JVM Tests - JDK 21 Semeru | Build |
Failures | Logs | Raw logs | 🔍 |
| ✔️ | JVM Tests - JDK 25 | Logs | Raw logs | 🔍 |
You can consult the Develocity build scans.
Failures
⚙️ JVM Tests - JDK 21 Semeru #
- Failing: extensions/panache/hibernate-orm-panache-kotlin/runtime
! Skipped: extensions/panache/hibernate-orm-panache-kotlin/deployment 📦 extensions/panache/hibernate-orm-panache-kotlin/runtime
❌ Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:2.3.0:compile (compile) on project quarkus-hibernate-orm-panache-kotlin: Compilation failure
Flaky tests - Develocity
⚙️ JVM Tests - JDK 17
📦 extensions/quartz/deployment
❌ io.quarkus.quartz.test.PausedSchedulerTest.testSchedulerPauseResume - History
expected: <false> but was: <true>-org.opentest4j.AssertionFailedError
Details
org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:158)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)
at org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:69)
at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:41)
at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:35)
at org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:246)
at io.quarkus.quartz.test.PausedSchedulerTest.testSchedulerPauseResume(PausedSchedulerTest.java:47)
⚙️ JVM Tests - JDK 17 Windows
📦 extensions/micrometer-opentelemetry/deployment
❌ io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod - History
Stream has no elements-java.lang.IllegalArgumentException
Details
java.lang.IllegalArgumentException: Stream has no elements
at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lambda$lastReading$2(MetricDataFilter.java:214)
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReading(MetricDataFilter.java:214)
at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReadingDataPoint(MetricDataFilter.java:232)
at io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod(MicrometerTimedInterceptorTest.java:76)
📦 extensions/quartz/deployment
❌ io.quarkus.quartz.test.PausedSchedulerTest.testSchedulerPauseResume - History
expected: <false> but was: <true>-org.opentest4j.AssertionFailedError
Details
org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:158)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:139)
at org.junit.jupiter.api.AssertFalse.failNotFalse(AssertFalse.java:69)
at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:41)
at org.junit.jupiter.api.AssertFalse.assertFalse(AssertFalse.java:35)
at org.junit.jupiter.api.Assertions.assertFalse(Assertions.java:246)
at io.quarkus.quartz.test.PausedSchedulerTest.testSchedulerPauseResume(PausedSchedulerTest.java:47)
⚙️ Maven Tests - JDK 17
📦 integration-tests/maven
❌ io.quarkus.maven.it.DevMojoIT.testThatApplicationRecoversStartupIssue - History
Condition with Lambda expression in io.quarkus.test.devmode.util.DevModeClient was not fulfilled within 20 minutes.-org.awaitility.core.ConditionTimeoutException
Details
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.test.devmode.util.DevModeClient was not fulfilled within 20 minutes.
at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1160)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1129)
at io.quarkus.test.devmode.util.DevModeClient.getHttpErrorResponse(DevModeClient.java:125)
at io.quarkus.test.devmode.util.DevModeClient.getHttpErrorResponse(DevModeClient.java:116)
❌ io.quarkus.maven.it.DevMojoIT.testThatApplicationRecoversStartupIssue - History
Condition with Lambda expression in io.quarkus.test.devmode.util.DevModeClient was not fulfilled within 20 minutes.-org.awaitility.core.ConditionTimeoutException
Details
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.test.devmode.util.DevModeClient was not fulfilled within 20 minutes.
at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1160)
at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1129)
at io.quarkus.test.devmode.util.DevModeClient.getHttpErrorResponse(DevModeClient.java:125)
at io.quarkus.test.devmode.util.DevModeClient.getHttpErrorResponse(DevModeClient.java:116)
⚙️ JVM Integration Tests - JDK 21 Semeru
📦 integration-tests/mailer
❌ io.quarkus.it.mailer.MailerTest.sendHtmlEmail - History
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException-java.lang.RuntimeException
Details
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:668)
at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:763)
at java.base/java.util.Optional.orElseGet(Optional.java:364)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at io.quarkus.test.junit.TestResourceUtil$TestResourceManagerReflections.startReflectively(TestResourceUtil.java:217)
📦 integration-tests/virtual-threads/grpc-virtual-threads
❌ io.quarkus.grpc.example.streaming.VirtualThreadTest.testGrpcClient - History
1 expectation failed. Expected status code <200> but was <500>.-java.lang.AssertionError
Details
java.lang.AssertionError:
1 expectation failed.
Expected status code <200> but was <500>.
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:60)
Fixes #51688
The issue is interesting as using JaCoCo causes the
MemoryClassPathElementhosting the transformed classes to be massive, thus making the two leaks very very visible.The first one manifests as:
The second one manifests as:
See individual commits for the details.
Now let's hope it doesn't break CI :).