-
Notifications
You must be signed in to change notification settings - Fork 14.9k
KAFKA-7386: streams-scala should not cache serdes #5622
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-7386: streams-scala should not cache serdes #5622
Conversation
bbejeck
left a comment
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.
thanks @vvcephei LGTM
|
Mutablility... |
|
@joan38 , Yeah, sort of... What's actually going on is more like dependency injection. The class is being configured after creation and then cached. But, yes, this can be (and has been) a source of bugs. |
|
Ok, @guozhangwang , I think this is good to go. |
|
LGTM! |
Currently, scala.Serdes.String, for example, invokes Serdes.String() once and caches the result. However, the implementation of the String serde has a non-empty configure method that is variant in whether it's used as a key or value serde. So we won't get correct execution if we create one serde and use it for both keys and values. Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
|
Cherry-picked to 2.0 as well. |
|
Thanks @guozhangwang |
|
This is definitely mutability and makes the implicit usage quite suspect. Unfortunate. :( |
Currently, scala.Serdes.String, for example, invokes Serdes.String() once and caches the result. However, the implementation of the String serde has a non-empty configure method that is variant in whether it's used as a key or value serde. So we won't get correct execution if we create one serde and use it for both keys and values. Reviewers: Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
Currently,
scala.Serdes.String, for example, invokes Serdes.String() once and caches the result.However, the implementation of the String serde has a non-empty configure method that is variant in whether it's used as a key or value serde. So we won't get correct execution if we create one serde and use it for both keys and values.
Committer Checklist (excluded from commit message)