gharris1727 commented on code in PR #13771:
URL: https://github.com/apache/kafka/pull/13771#discussion_r1212353945


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java:
##########
@@ -356,25 +357,16 @@ public static String prunedName(PluginDesc<?> plugin) {
      * Verify whether a given plugin's alias matches another alias in a 
collection of plugins.
      *
      * @param alias the plugin descriptor to test for alias matching.
-     * @param plugins the collection of plugins to test against.
+     * @param aliases the collection of plugins to test against.
      * @param <U> the plugin type.
      * @return false if a match was found in the collection, otherwise true.
      */
     public static <U> boolean isAliasUnique(
             PluginDesc<U> alias,
-            Collection<PluginDesc<U>> plugins
+            Map<String, String> aliases
     ) {
-        boolean matched = false;
-        for (PluginDesc<U> plugin : plugins) {
-            if (simpleName(alias).equals(simpleName(plugin))
-                    || prunedName(alias).equals(prunedName(plugin))) {
-                if (matched) {
-                    return false;
-                }
-                matched = true;
-            }
-        }
-        return true;
+        // TODO: Mark alias collision and disable ambiguous aliases completely.

Review Comment:
   I don't think that anyone should be depending on these cross-plugin 
ambiguous aliases, because if they were, they would be subject to spurious 
ClassNotFoundExceptions whenever the non-deterministic iteration order caused a 
plugin of the wrong type to be loaded.
   
   I've updated this PR to make the failure deterministic, and hopefully easier 
to debug and remediate. Additionally, I've added a warn log message that 
explicitly lists the ambiguous aliases and the full class names that they refer 
to.
   
   An alternative is to separate these aliases into per-plugin-type namespaces, 
but I don't think that is necessary at this time.



-- 
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

Reply via email to