Greg Harris created KAFKA-15162: ----------------------------------- Summary: Reflective plugin scanning misses plugins which are in parent classloaders but not classpath Key: KAFKA-15162 URL: https://issues.apache.org/jira/browse/KAFKA-15162 Project: Kafka Issue Type: Bug Components: KafkaConnect Reporter: Greg Harris Assignee: Greg Harris Fix For: 3.6.0
When the Plugins class is instantiated with a parent classloader other than the system classloader, as in these tests: [https://github.com/apache/kafka/blob/fd5b300b573dc41b94c710a791f9ee6f568992d4/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginsTest.java#L493-L501] Plugins which are present in that parent classloader but not in the app classloader are not visible. This is because the classes and resources become visible, but the set of URLs used for reflective scanning only includes the classpath jars: [https://github.com/apache/kafka/blob/fd5b300b573dc41b94c710a791f9ee6f568992d4/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java#L353] This causes a discrepancy between the Reflection and ServiceLoading scanners, because the Reflection scanner relies on these URLs but the ServiceLoader relies on the classes and resources instead. Either the tests should be rewritten to accommodate this difference in behavior, or the PluginUtils.pluginSources should be amended to make a best-effort evaluation of the parent classloader URLs. -- This message was sent by Atlassian Jira (v8.20.10#820010)