Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4247

kafka-run-class has potential to add a leading colon to classpath

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: KafkaConnect
    • Labels:
      None

      Description

      https://github.com/confluentinc/kafka/blob/trunk/bin/kafka-run-class.sh#L128-L133

      In the event CLASSPATH has not yet been populated this will result in

      :$file

      Normally this wouldn't be a problem however Connect's AbstractClassHearder uses ClasspathHelper.forJavaClassPath() to collect it's eligible classes.

      With a leading colon you will endup with a entry for null which is expanded to the working directory.

      java -cp ":" test
      []

      java -cp ":Users" test
      file:/Users/ryan/, file:/Users/ryan/Users

      This is problematic if the script was run from the root directory since the URLs will be scanned the directories recursively. Ultimately leading to a situation where the entire FileSystem is scanned. This has been known to cause issues for some Docker installations.

      Typically this is worked around by editing the the kafka-run-class script however I think we should handle this within Connect itself by excluding the root directory.

        Attachments

          Activity

            People

            • Assignee:
              Ryan P Ryan P
              Reporter:
              Ryan P Ryan P
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: