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

KafkaConfig and LogConfig should not have static initialization order dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.0.1
    • 0.10.1.1, 0.10.2.0
    • None
    • None

    Description

      LogConfig.configDef.serverDefaultConfigNames is not initialized properly in due to static initialization order dependencies between KafkaConfig and LogConfig. The map ends inserting null values, which are all string literals. Consider the following.

      1. KafkaConfig begins initialization at first because KafkaServer constructor needs KafkaConfig.
      2. at KafkaConfig.LogMessageFormatVersionProp it needs LogConfig.
      3. LogConfig begins initialization
      4. LogConfig.configDef begins initialization
      5. .define(UncleanLeaderElectionEnableProp....) needs KafkaConfig.UncleanLeaderElectionEnableProp, which is defined below KafkaConfig.LogMessageFormatVersionProp so it's null
      6. Can't start another initialization of KafkaConfig
      7. So .define inserts null. This is applicable to all three MinInSyncReplicasProp, UncleanLeaderElectionEnableProp, and CompressionTypeProp

      Attachments

        Issue Links

          Activity

            People

              sutambe Sumant Tambe
              sutambe Sumant Tambe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: