Skip to content
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

Close the deployment CL in the creator when augmenting #41437

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jun 25, 2024

⚠️ better reviewed by ignoring whitespaces: https://github.com/quarkusio/quarkus/pull/41437/files?diff=unified&w=1

Currently, we pass the CL to something that will close it, rather than controlling the lifecycle in the creator method.

This is an issue in native ITs:

java.lang.RuntimeException: java.lang.IllegalStateException: This class loader has been closed
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.throwBootFailureException(QuarkusIntegrationTestExtension.java:373)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.beforeEach(QuarkusIntegrationTestExtension.java:117)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.IllegalStateException: This class loader has been closed
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.ensureOpen(QuarkusClassLoader.java:716)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:495)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.performCustomBuild(AugmentActionImpl.java:158)
	at io.quarkus.test.junit.IntegrationTestUtil.handleDevServices(IntegrationTestUtil.java:297)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.doProcessStart(QuarkusIntegrationTestExtension.java:199)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.ensureStarted(QuarkusIntegrationTestExtension.java:169)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.beforeAll(QuarkusIntegrationTestExtension.java:130)

Related to #41233

Currently, we pass the CL to something that will close it, rather than
controlling the lifecycle in the creator method.

This is an issue in native ITs:

java.lang.RuntimeException: java.lang.IllegalStateException: This class loader has been closed
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.throwBootFailureException(QuarkusIntegrationTestExtension.java:373)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.beforeEach(QuarkusIntegrationTestExtension.java:117)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.IllegalStateException: This class loader has been closed
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.ensureOpen(QuarkusClassLoader.java:716)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:495)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.performCustomBuild(AugmentActionImpl.java:158)
	at io.quarkus.test.junit.IntegrationTestUtil.handleDevServices(IntegrationTestUtil.java:297)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.doProcessStart(QuarkusIntegrationTestExtension.java:199)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.ensureStarted(QuarkusIntegrationTestExtension.java:169)
	at io.quarkus.test.junit.QuarkusIntegrationTestExtension.beforeAll(QuarkusIntegrationTestExtension.java:130)

Related to quarkusio#41233
@gsmet gsmet requested a review from geoand June 25, 2024 15:02
@quarkus-bot quarkus-bot bot added area/core area/jbang Issues related to when using jbang.dev with Quarkus labels Jun 25, 2024
@geoand
Copy link
Contributor

geoand commented Jun 25, 2024

rather than controlling the lifecycle in the creator method

Where is this done?

@gsmet
Copy link
Member Author

gsmet commented Jun 25, 2024

@geoand
Copy link
Contributor

geoand commented Jun 25, 2024

That's my question, where does it get closed with this change?

@gsmet
Copy link
Member Author

gsmet commented Jun 25, 2024

Ah, OK. I use try with resources to close them.

@geoand
Copy link
Contributor

geoand commented Jun 25, 2024

Gotcha, thanks

@gsmet gsmet merged commit ec71cc9 into quarkusio:main Jun 26, 2024
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.13 - main milestone Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core area/jbang Issues related to when using jbang.dev with Quarkus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants