-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-8425: Fix for correctly handling immutable maps (KIP-421 bug) #6795
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
Changes from 1 commit
94f0767
1ec3053
f89a914
5d4bca6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -363,6 +363,19 @@ public void testConfigProvidersPropsAsParam() { | |
| assertEquals(config.originals().get("sasl.kerberos.password"), "randomPassword"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testImmutableOriginalsWithConfigProvidersProps() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this test fail without the change?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tadsul, what is the answer to this question? (Unresolving this conversation.)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes the test fails without the comment
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I am not sure it would. You should run the test without the changes to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yes i had to modify the test to make it work .. my yes meant that i could reproduce the issue.. sorry about that i will post the modified test |
||
| // Test Case: Valid Test Case for ConfigProviders as a separate variable | ||
| Properties providers = new Properties(); | ||
| providers.put("config.providers", "file"); | ||
| providers.put("config.providers.file.class", "org.apache.kafka.common.config.provider.MockFileConfigProvider"); | ||
| Properties props = new Properties(); | ||
| props.put("sasl.kerberos.key", "${file:/usr/kerberos:key}"); | ||
| final Map<String, ?> immutableMap = convertPropertiesToMap(providers); | ||
| TestIndirectConfigResolution config = new TestIndirectConfigResolution(props, immutableMap); | ||
| assertEquals(config.originals().get("sasl.kerberos.key"), "testKey"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testAutoConfigResolutionWithMultipleConfigProviders() { | ||
| // Test Case: Valid Test Case With Multiple ConfigProviders as a separate variable | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird to convert an immutable map to mutable and never convert back. Could we refactor the logic to push up the modification logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tadsul We could perhaps convert this to a immutable map and store
inoriginalslike we do forvalues`.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest naming this variable
resolvedOriginals.