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

Chris M. Hostetter commented on KAFKA-17770:
--------------------------------------------

A few other notes...
 * This is very similar to (the very old) KAFKA-3548 - but with a diff enum and 
diff code doing the uppercasing.
 * Anecdotal info found on StackOverflow suggest that:
 ** this can affect "non-test" kafka server installs – meaning the start 
scripts don't explicitly override the OS's Locale
 *** 
[https://stackoverflow.com/questions/78753257/error-starting-kafka-on-macos-java-lang-illegalargumentexception-no-enum-const]
 ** This problem _may_ be newly introduced in Kafka 3.7 (but i didn't verify 
this)
 *** 
[https://stackoverflow.com/questions/78218951/fatal-exception-error-while-firing-kafka-server]
 * I would _strongly_ encourage the kafka community to start using 
randomization of system defaults (locale, file encoding, timezone, etc.) in 
tests to help find problems like this in the future
 ** [https://github.com/randomizedtesting]

> system default Locale sensitivity in scala code uppercasing enums
> -----------------------------------------------------------------
>
>                 Key: KAFKA-17770
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17770
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Chris M. Hostetter
>            Priority: Major
>
> Code that invokes {{kafka.server.KafkaConfig}} can encounter "No enum 
> constant" for values that (IIUC) come from implicit defaults – {_}When the 
> system default Locale has uppercase rules that differ from English{_}!
> This may not affect most kafka server deployments, but it can easily come up 
> when using embedded kafka for testing purposes – especially in downstream 
> projects that [explicitly randomize their locales 
> |http://labs.carrotsearch.com/randomizedtesting.html]to check for behavior 
> like this.
> Below is an example stack trace from a test that uses 
> {{org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster}} (with no 
> custom configuration) when using the "az" locale (Similar errors can happen 
> with the "tr-TR" locale, etc...)
> Note that the "I" in {{GroupType.CLASSİC}} is actually {{U+0130}} (not 
> {{{}U+0049{}}})
> {noformat}
>    >     java.lang.IllegalArgumentException: No enum constant 
> org.apache.kafka.coordinator.group.Group.GroupType.CLASSİC
>    >         at java.base/java.lang.Enum.valueOf(Enum.java:273)
>    >         at 
> org.apache.kafka.coordinator.group.Group$GroupType.valueOf(Group.java:29)
>    >         at 
> kafka.server.KafkaConfig.$anonfun$groupCoordinatorRebalanceProtocols$2(KafkaConfig.scala:2020)
>    >         at 
> scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:100)
>    >         at 
> scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:87)
>    >         at scala.collection.mutable.ArrayBuffer.map(ArrayBuffer.scala:43)
>    >         at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:2020)
>    >         at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1639)
>    >         at 
> org.apache.kafka.streams.integration.utils.KafkaEmbedded.<init>(KafkaEmbedded.java:72)
>    >         at 
> org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster.start(EmbeddedKafkaCluster.java:131)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to