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

ASF GitHub Bot commented on KAFKA-8819:
---------------------------------------

mageshn commented on pull request #7236: KAFKA-8819 : fix plugin path loader 
for converter
URL: https://github.com/apache/kafka/pull/7236
 
 
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Plugin path for converters not working as intended
> --------------------------------------------------
>
>                 Key: KAFKA-8819
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8819
>             Project: Kafka
>          Issue Type: Bug
>          Components: KafkaConnect
>            Reporter: Magesh kumar Nandakumar
>            Assignee: Magesh kumar Nandakumar
>            Priority: Major
>
> KafakConnect allows all plugins to be available via a plugin path mechanism. 
> This allows for classpath isolation. This is not working as designed under 
> the following circumstances for Converters
>  
> I have 2 directories under plugin path `connector1` and `connector2`. I 
> intend to use AvroConverter and its available in both the plugin directories. 
> Under these circumstances, the Worker attempts to create the Converter 
> available in the plugin director first which should ideally be deterministic 
> but it's not because of the following reasons:-
>  
> [https://github.com/apache/kafka/blob/aa4ba8eee8e6f52a9d80a98fb2530b5bcc1b9a11/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java#L421]
>  would lead to all configs of type Class to be loaded and this would mean 
> that they are not loaded in the context of the connectors plugin loader. 
> IIUC, the current loaded would be the DelegatingClassLoader. This would mean 
> that the AvroConverter could potentially be loaded from connector2 plugin 
> path while loading the class. This should be made deterministic as intended. 
> i.e. if a Converter class is in the connector's plugin path that should be 
> given the first priority.
>  
> The converter is created and configured with the current class loaded as the 
> Connector's class loader. This will not work if the converter uses reflection 
> or other mechanisms like ServiceLoader in its constructor or configure 
> method. Considering that the current class loader should be set to the 
> Converter's class loaded while doing these operations. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to