GitHub user StefanRRichter opened a pull request: https://github.com/apache/flink/pull/5880
[FLINK-8836] Fix duplicate method in KryoSerializer to perform deep c⦠â¦opy of default/registered serializer instances. This method did create deep copies of registered or default serializer instances and as a result those serializer instances can accidentally be shared across different threads. ## Brief change log This PR fixes a problem with the `duplicate` method of `KryoSerializer`. We do now perform deep copies for default and registered serializer objects. Otherwise, if we share duplicated `KryoSerializer` instances across different threads, some of their internal serializers might be a shared instance of a stateful object. ## Verifying this change This change added tests and can be verified by running `KryoSerializerConcurrencyTest`. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (yes) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (indirectly) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? ( no) - If yes, how is the feature documented? (not applicable) You can merge this pull request into a Git repository by running: $ git pull https://github.com/StefanRRichter/flink FLINK-8836 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5880.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5880 ---- commit 617ebd114b86d8f00d15e53dd649bb633fc717f9 Author: Stefan Richter <s.richter@...> Date: 2018-04-19T13:10:07Z [FLINK-8836] Fix duplicate method in KryoSerializer to perform deep copy of default/registered serializer instances. This method did create deep copies of registered or default serializer instances and as a result those serializer instances can accidentally be shared across different threads. ---- ---