[
https://issues.apache.org/jira/browse/KAFKA-4395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15651674#comment-15651674
]
ASF GitHub Bot commented on KAFKA-4395:
---------------------------------------
GitHub user sutambe opened a pull request:
https://github.com/apache/kafka/pull/2120
KAFKA-4395: Break static initialization order dependency between
KafkaConfig and Logconfig
Fixes static initialization order dependency between KafkaConfig and
LogConfig.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sutambe/kafka logconfig-static-init
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/2120.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2120
----
commit 0a9690981aeaf6a2c50d32a504815d1b041e3089
Author: Sumant Tambe <[email protected]>
Date: 2016-11-09T18:19:40Z
KAFKA-4395 fixes static initialization order depedency between KafkaConfig
and LogConfig
commit 7f7a9ec820e3fe65bcb9f2bd544fb2322a897e11
Author: Sumant Tambe <[email protected]>
Date: 2016-11-09T18:27:00Z
removed commented line
----
> KafkaConfig and LogConfig should not have static initialization order
> dependencies
> ----------------------------------------------------------------------------------
>
> Key: KAFKA-4395
> URL: https://issues.apache.org/jira/browse/KAFKA-4395
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 0.10.0.1
> Reporter: Sumant Tambe
> Assignee: Sumant Tambe
> Fix For: 0.10.1.1
>
>
> 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
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)