[ 
https://issues.apache.org/jira/browse/KAFKA-17117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17865134#comment-17865134
 ] 

Greg Harris commented on KAFKA-17117:
-------------------------------------

Considering that the only plugins typically on the classpath are the Apache 
Kafka plugins, this is even less harmful. Only AK plugins need to watch out for 
the odd classloader, and there are not too many of them, so the time spent 
scanning them is minimal.

> Avoid instantiating classpath plugins when service loading plugins
> ------------------------------------------------------------------
>
>                 Key: KAFKA-17117
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17117
>             Project: Kafka
>          Issue Type: Improvement
>          Components: connect
>    Affects Versions: 3.6.0
>            Reporter: Greg Harris
>            Priority: Minor
>
> In KAFKA-14789 modifications were made to allow PluginClassLoaders to see all 
> resource files of the parent DelegatingClassLoader and classpath, rather than 
> selectively hiding some resources that were for ServiceLoader manifests.
> This has the effect that the ServiceLoader finds classpath plugins when 
> searching in plugin locations, and the PluginScanner filters these plugins 
> out by checking for classloader equality.
> This has some side-effects that are undesirable:
>  * Classpath plugins may be instantiated with the thread context classloader 
> set to a plugin classloader
>  * Classpath plugins are instantiated multiple times, once for each plugin 
> location
>  * Exceptions from classpath plugins show up multiple times in the logs: 
> KAFKA-17111
> This change may require us to fork the ServiceLoader implementation, which is 
> itself undesirable.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to