kpatelatwork commented on a change in pull request #10549:
URL: https://github.com/apache/kafka/pull/10549#discussion_r616169919



##########
File path: 
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java
##########
@@ -208,6 +228,22 @@ protected void initLoaders() {
         // Finally add parent/system loader.
         initPluginLoader(CLASSPATH_NAME);
         addAllAliases();
+        reportPluginConflicts();
+    }
+
+    //visible for testing
+    Set<String> reportPluginConflicts() {
+        Set<String> conflictPluginClasses = new HashSet<>();
+        for (Map.Entry<String, List<PluginDesc<?>>> entry : 
allAddedPlugins.entrySet()) {
+            String pluginClassName = entry.getKey();
+            List<PluginDesc<?>> pluginDescriptors = entry.getValue();
+            if (pluginDescriptors.size() > 1) {
+                PluginDesc<?> pluginDescInUse = 
pluginDescInUse(pluginClassName);
+                log.error("For plugin '{}', detected multiple copies '{}', 
this copy '{}' will be used.", pluginClassName, pluginDescriptors, 
pluginDescInUse);
+                conflictPluginClasses.add(pluginClassName);
+            }
+        }
+        return conflictPluginClasses;

Review comment:
       Applied all the changes. @rhauch please check now.




-- 
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:
us...@infra.apache.org


Reply via email to