Skip to content

fix: DH-22075: Improve Groovy/QueryLibrary/QLP classloader handling#7829

Open
niloc132 wants to merge 13 commits intodeephaven:mainfrom
niloc132:22075-classloading-issues
Open

fix: DH-22075: Improve Groovy/QueryLibrary/QLP classloader handling#7829
niloc132 wants to merge 13 commits intodeephaven:mainfrom
niloc132:22075-classloading-issues

Conversation

@niloc132
Copy link
Member

No description provided.

@niloc132 niloc132 added this to the 42.0 milestone Mar 23, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

No docs changes detected for 062e845

updateVersionString();
}

@Deprecated
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we want to deprecate or not - i don't have this new impl, where the caller gets specifics for their classloader? will need release notes for any potential users (probably none exist).

@niloc132 niloc132 force-pushed the 22075-classloading-issues branch from 5a44bbd to dd785d0 Compare March 24, 2026 16:59
@niloc132 niloc132 marked this pull request as ready for review March 26, 2026 15:42
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.objectweb.asm.ClassWriter;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new unused imports

ClassLoader cl2 = makeClassloaderWithClass(binaryName, 456);
Class<?> aClass2 = cl2.loadClass(binaryName);
assertNotEquals(aClass, aClass2);
Thread.currentThread().setContextClassLoader(cl2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have an @AfterEach to clean up the context classloader?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or at least a try/finally, yeah, that would be wise.


Table t1 = session.getQueryScope().readParamValue("t1");
Table t2 = session.getQueryScope().readParamValue("t2");
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better pattern is like this:
final IllegalArgumentException iae =
assertThrows(IllegalArgumentException.class, () -> arraySource.countBy("Count", "Key"));
assertEquals("Cannot aggregate using an array column: Key, column type is an array of int", iae.getMessage());

"}\n" +
"ExecutionContext.getContext().getQueryLibrary().importStatic(MyClass)\n" +
"t = TestGroovyDeephavenSession.makeTickingTable()\n" +
// "pt = t.partitionBy('I').transform(ExecutionContext.getContext(), { t -> if (t.size() !=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dead code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants