You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Nigel Liang (Jira)" <ji...@apache.org> on 2020/03/12 19:17:00 UTC

[jira] [Comment Edited] (KAFKA-9712) Reflections library 0.9.12 introduced in 2.5 causes regression scanning for plugins on plugin_path

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

Nigel Liang edited comment on KAFKA-9712 at 3/12/20, 7:16 PM:
--------------------------------------------------------------

I have concluded more testing. My conclusion is that any file on the plugin path that is either:
 # not a jar, or
 # a jar containing no classes

will trigger the bug. Consequence is that connect worker will not be able to start up.
  
 Possible workarounds include but are not limited to: * Revert back to v0.9.11
 * Switch to reflections8 fork similar to what is done here - [https://github.com/JanusGraph/janusgraph/pull/2029]
 * Try to catch and handle the exception by skipping the problematic file and continuing the scan


was (Author: nigel.liang):
I have concluded more testing. My conclusion is that any file on the plugin path that is either: # not a jar, or
 # a jar containing no classes

will trigger the bug. Consequence is that connect worker will not be able to start up.
 
Possible workarounds include but are not limited to: * Revert back to v0.9.11
 * Switch to reflections8 fork similar to what is done here - [https://github.com/JanusGraph/janusgraph/pull/2029]
 * Try to catch and handle the exception by skipping the problematic file and continuing the scan

> Reflections library 0.9.12 introduced in 2.5 causes regression scanning for plugins on plugin_path
> --------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-9712
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9712
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 2.5.0
>            Reporter: Nigel Liang
>            Priority: Major
>
> Reflections v0.9.12 was introduced in 2.5 branch to remove Guava dependency - https://issues.apache.org/jira/browse/KAFKA-3061
> This version, however, contains a [bug|https://github.com/ronmamo/reflections/issues/273] that will cause regression when scanning for plugins if the `plugins_path` specified does not contain valid plugins. The case where we were able to repro this, the `plugins_path` was misconfigured to point to `~/.ssh` which contained unrelated files but no plugins. Further testing is needed to figure out if it will repro for other cases such as empty directory, combination of valid and invalid plugins in directory, just some types of plugins and not others in directory, etc.
> {code}
> [2020-03-12 18:07:01,045] INFO Loading plugin from: /home/ducker/.ssh (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader)
> [2020-03-12 18:07:01,047] DEBUG Loading plugin urls: [] (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader)
> [2020-03-12 18:07:01,062] ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectDistributed)
> org.reflections.ReflectionsException: Scanner SubTypesScanner was not configured
>         at org.reflections.Store.get(Store.java:39)
>         at org.reflections.Store.get(Store.java:61)
>         at org.reflections.Store.get(Store.java:46)
>         at org.reflections.Store.getAll(Store.java:93)
>         at org.reflections.Reflections.getSubTypesOf(Reflections.java:404)
>         at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.getPluginDesc(DelegatingClassLoader.java:342)
>         at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:327)
>         at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:260)
>         at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.registerPlugin(DelegatingClassLoader.java:252)
>         at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:221)
>         at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:198)
>         at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:60)
>         at org.apache.kafka.connect.cli.ConnectDistributed.startConnect(ConnectDistributed.java:91)
>         at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:78)
> {code}



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