-
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
Fix faulty class loader #43718
Fix faulty class loader #43718
Conversation
Nice catch @dmlloyd ! |
Status for workflow
|
Status | Name | Step | Failures | Logs | Raw logs | Build scan |
---|---|---|---|---|---|---|
✔️ | JVM Tests - JDK 17 | Logs | Raw logs | 🔍 | ||
✖ | JVM Tests - JDK 21 | Build |
Failures | Logs | Raw logs | 🔍 |
Full information is available in the Build summary check run.
You can consult the Develocity build scans.
Failures
⚙️ JVM Tests - JDK 21 #
- Failing: extensions/reactive-mysql-client/deployment
! Skipped: integration-tests/hibernate-reactive-mariadb integration-tests/hibernate-reactive-mysql integration-tests/hibernate-reactive-mysql-agroal-flyway and 1 more
📦 extensions/reactive-mysql-client/deployment
✖ io.quarkus.reactive.mysql.client.MySQLPoolProducerTest.
- History - More details - Source on GitHub
java.lang.RuntimeException:
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor#launchDatabases threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image docker.io/mysql:8.4
at io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor.startDevDb(DevServicesDatasourceProcessor.java:367)
at io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor.launchDatabases(DevServicesDatasourceProcessor.java:121)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)
at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
very nice find - any chance this could explain some of the classloader leaks we've been battling with ? |
I don't think so. IIRC, this class loader is only used for IDE launching and JBang. |
The class loader as it is written will always delegate to the parent class loader first looking for the bytes of the class. This is very bad if the parent class loader happens to have the class, as is the case when a JBang library overlaps with a Quarkus one. This results in the
RuntimeLauncherClassLoader
defining the class as if it found it in its own set of resources, however the class bytes actually came from the JBang class loader (all of the class loaders involved are parent-first, so it goes right up to the top).A class loader should never search for class resources outside of its own search path (particularly in parent class loaders). So, the fix is to look for the
ide-launcher-res
resource exclusively. If it's not found there, we can safely fail because the class loader is parent-first, so there'd be nothing left to search anyway.Should fix #43648, which should be rebased after this. Fixes #43681.