KAFKA-15156: Update cipherInformation correctly in DefaultChannelMetadataRegistry#13966
KAFKA-15156: Update cipherInformation correctly in DefaultChannelMetadataRegistry#13966machi1990 wants to merge 4 commits intoapache:trunkfrom
Conversation
|
ping @divijvaidya can you have a look? Thanks |
dajac
left a comment
There was a problem hiding this comment.
Thanks for the PR. I left a comment below.
There was a problem hiding this comment.
Could you elaborate on what is wrong with the previous implementation? If there is a bug, would it be possible to reproduce it in a unit test?
There was a problem hiding this comment.
+1 to add a unit test.
The previous implementation will not update the cipherInformation if one already exists. This is inconsistent with the implementation in other implementation of ChannelMetadataRegistry i.e. SelectorChannelMetadataRegistry, hence, makes me believe that the expected behaviour is to replace the member if it already exists. Note that this file is only used in tests so far.
There was a problem hiding this comment.
I don't recall why we added this check. I think that the cipher can only be set once per connection so this may be the reason. I suppose that it is fine to remove it in this case. I am not sure about the Objects.requireNonNull though.
As this file is only used in tests, it would also make sense to move it to the test source tree.
There was a problem hiding this comment.
Thanks @dajac @divijvaidya for the review. I've added a new test following this change.
There was a problem hiding this comment.
I am not sure about the Objects.requireNonNull though.
can you expand on this @dajac ?
As this file is only used in tests, it would also make sense to move it to the test source tree.
I am okay with this. Will we want to keep the added unit test in this case, any thoughts? @dajac @divijvaidya
There was a problem hiding this comment.
Will we want to keep the added unit test in this case, any thoughts?
No. unit test for a test will not be required in that case. Let's move that file to tests. Although it's a public class but it cannot be used outside of Kafka code base.
There was a problem hiding this comment.
Thanks for the reply. I've updated the PR.
|
@machi1990 please check test failures |
The CI issue was due to an issue which has been fixed by #14037 |
…tion is properly registered and re-registered
|
I've limited bandwidth thus I won't be able to carry this work forward. I'll happily close this MR and unassign myself from the JIRA for someone else to take it over. |
Committer Checklist (excluded from commit message)