You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/06/11 02:52:24 UTC

[GitHub] [kafka] rhauch commented on a change in pull request #8455: KAFKA-9845: Warn users about using config providers with plugin.path property

rhauch commented on a change in pull request #8455:
URL: https://github.com/apache/kafka/pull/8455#discussion_r438513748



##########
File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfig.java
##########
@@ -379,6 +382,22 @@ private void logDeprecatedProperty(String propName, String propValue, String def
         }
     }
 
+    private void logPluginPathConfigProviderWarning(Map<String, String> rawOriginals) {
+        String rawPluginPath = rawOriginals.get(PLUGIN_PATH_CONFIG);
+        // Can't use AbstractConfig::originalsStrings here since some values may be null, which
+        // causes that method to fail
+        String transformedPluginPath = Objects.toString(originals().get(PLUGIN_PATH_CONFIG));
+        if (!Objects.equals(rawPluginPath, transformedPluginPath)) {
+            log.warn(
+                "Config providers do not work with the plugin.path property. The raw value '{}' " 
+                    + "will be used for plugin scanning, as opposed to the transformed value '{}'. " 
+                    + "See https://issues.apache.org/jira/browse/KAFKA-9845 for more information.",

Review comment:
       How about:
   ```suggestion
                   "Variables cannot be used in the 'plugin.path' property, since the property is "
                   + "used by plugin scanning before the config providers that replace the " 
                   + "variables are initialized. The raw value '{}' was used for plugin scanning, as " 
                   + "opposed to the transformed value '{}', and this may cause unexpected results.",
   ```

##########
File path: connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfig.java
##########
@@ -205,7 +206,9 @@
             + "plugins and their dependencies\n"
             + "Note: symlinks will be followed to discover dependencies or plugins.\n"
             + "Examples: plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,"
-            + "/opt/connectors";
+            + "/opt/connectors\n" 
+            + "Warning: Config providers will not take effect if used for the value of this " 
+            + "property, and instead the raw, non-transformed value will be used.";

Review comment:
       How about:
   ```suggestion
               + "/opt/connectors\n" 
               + "Do not use config provider variables in this property, since the raw path is used "
               + "by the worker's scanner before config providers are initialized and used to "
               + "replace variables.";
   ```




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