Provide insightful information for classloader issues#24973
Merged
wendigo merged 1 commit intotrinodb:masterfrom Feb 10, 2025
Merged
Provide insightful information for classloader issues#24973wendigo merged 1 commit intotrinodb:masterfrom
wendigo merged 1 commit intotrinodb:masterfrom
Conversation
be18254 to
98559ce
Compare
raunaqmorarka
approved these changes
Feb 10, 2025
findepi
reviewed
Feb 10, 2025
This saves time while diagnosing issue like: ``` tests | Caused by: java.lang.ClassNotFoundException: SPI class 'io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder' was not found in the SPI classloader, but was found in the 'delta-lake' plugin classloader tests | at io.trino.server.PluginClassLoader.loadClass(PluginClassLoader.java:108) tests | at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528) tests | ... 79 more tests | Caused by: java.lang.ClassNotFoundException: io.opentelemetry.api.incubator.metrics.ExtendedDoubleHistogramBuilder tests | at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) tests | at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) tests | at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:528) tests | at io.trino.server.PluginClassLoader.loadClass(PluginClassLoader.java:104) tests | ... 80 more ```
98559ce to
4886aa1
Compare
martint
reviewed
Feb 10, 2025
| private boolean hasClassLocally(String name, boolean resolve) | ||
| { | ||
| try { | ||
| super.loadClass(name, resolve); |
Member
There was a problem hiding this comment.
This is potentially problematic. This will have the side effects that the class may get loaded, the caller will throw an exception that may be caught by someone else, and things may start behaving in unexpected ways.
Contributor
Author
There was a problem hiding this comment.
This was already problematic if the class belong to an SPI_PACKAGES but couldn't be loaded through the SPI class loader. I've faced this issue recently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This saves time while diagnosing issue like:
Description
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.