gharris1727 commented on code in PR #16984: URL: https://github.com/apache/kafka/pull/16984#discussion_r1871863655
########## connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java: ########## @@ -240,6 +261,21 @@ public Runnable withClassLoader(ClassLoader classLoader, Runnable operation) { }; } + public static LoaderSwap swapLoader(ClassLoader loader) { Review Comment: Okay I thought about this some more. The fact that this is static can be fixed later. But the fact that we're using plugin.getClass().getClassLoader() to get the ClassLoader is incorrect, and I think either needs a Plugins instance to call connectorLoader, or needs new ClassLoader fields anyway, so it may not be that much work to add the Plugins field as well. The only thing we need to avoid is accidentally swapping to the AppClassLoader (parent of DelegatingClassLoader) instead of the DelegatingClassLoader itself, because that actually would make some classes less visible to plugins. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org