Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-14962: Trim whitespace from ACL configuration #13670

Merged
merged 3 commits into from May 12, 2023

Conversation

divijvaidya
Copy link
Contributor

Kafka's startup can fail (see the exception trace below) if there is a trailing or leading whitespace for a configuration value. This fix makes it more tolerant towards cases where a user might accidentally add a trailing or leading whitespace in ACL configuration.

ERROR [KafkaServer id=3] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)

java.lang.IllegalArgumentException: For input string: "true "

    at scala.collection.StringOps$.toBooleanImpl$extension(StringOps.scala:943)

    at kafka.security.authorizer.AclAuthorizer.$anonfun$configure$4(AclAuthorizer.scala:153) 

@divijvaidya
Copy link
Contributor Author

The failing tests are unrelated:

Build / JDK 8 and Scala 2.12 / testElectUncleanLeadersForOnePartition(String).quorum=kraft – kafka.api.PlaintextAdminIntegrationTest
26s
Build / JDK 11 and Scala 2.13 / testSingleNodeCluster() – org.apache.kafka.connect.mirror.integration.DedicatedMirrorIntegrationTest
1m 18s
Build / JDK 11 and Scala 2.13 / testMultiNodeCluster() – org.apache.kafka.connect.mirror.integration.DedicatedMirrorIntegrationTest
1m 52s
Build / JDK 11 and Scala 2.13 / testReplicateSourceDefault() – org.apache.kafka.connect.mirror.integration.MirrorConnectorsIntegrationExactlyOnceTest

Copy link
Collaborator

@clolov clolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I have encountered similar problems even with configurations so it might be useful to circle back later on and check whether trimming happens there. Thanks!

Copy link
Contributor

@omkreddy omkreddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@divijvaidya Thanks for the PR. LGTM

@omkreddy omkreddy merged commit bb10ae4 into apache:trunk May 12, 2023
1 check failed
@divijvaidya
Copy link
Contributor Author

@omkreddy Thank you for your review bandwidth to merge this in 🙏

@divijvaidya divijvaidya deleted the KAFKA-14962 branch May 15, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants