gharris1727 opened a new pull request, #14398: URL: https://github.com/apache/kafka/pull/14398
In #14089 the PluginDesc::compareTo method was changed, such that plugins with the same name and version but different classloaders could be given a consistent order. This caused compareTo to return non-zero values where previously it returned zero. The compareTo method is used by TreeSet to determine uniqueness in lieu of the more typical equals() in other Set implementations. This means that the PluginScanResult now stored multiple copies of a plugin with the same "name", which was beneficial for the connect-plugin-path script where the distinction was valuable. DelegatingClassLoader::computePluginLoaders already disambiguates among multiple PluginDescs for the same plugin name by picking the "last" one, as defined by compareTo. However, the ConnectorPluginsResource does not disambiguate in the same way, and instead just forwards the list of plugins as PluginInfo objects, which contain only the class, type, and version of the plugin. This means that when a plugin is provided by multiple sources but with the exact same class, type, and version, the `/connector-plugins` endpoint contains confusing duplicates. Instead of showing duplicates without any information to distinguish them, we should hide the trivial duplicates (duplicates where PluginInfo::equals is true). In order to verify this, the ConnectorPluginsResourceTest is changed to assert on the returned List rather than a Set, to detect duplicates. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- 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