[ https://issues.apache.org/jira/browse/FLINK-8802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16396910#comment-16396910 ]
ASF GitHub Bot commented on FLINK-8802: --------------------------------------- GitHub user kl0u opened a pull request: https://github.com/apache/flink/pull/5691 [FLINK-8802] [QS] Fix concurrent access to non-duplicated serializers. ## What is the purpose of the change This fixes the problem of multiple threads using the same serializer instance to concurrently deserialize requests. ## Brief change log Now the `KvStateRegistry` holds a `KvStateEntry` for each registered `InternalKvState` and in that entry we have a cache that holds a copy of the serializer per thread, if the serializer is stateful. If it is stateless, we do not need to copy the serializer. ## Verifying this change There is a test added in the `KvStateRegistryTest`, the `KvStateRegistryTest#testKvStateEntry()` and also I have tested it with an actual job (but I run it locally). ## 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: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no - 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/kl0u/flink improved-qs-inv Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5691.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 #5691 ---- commit 595a59c30dfc778945c43351edf8dbc2887b6a87 Author: kkloudas <kkloudas@...> Date: 2018-03-09T11:05:38Z [FLINK-8908] Do not create copy when MapSerializer stateless. commit 1a8c0415cec46ed6683768b793c295ab478b2eb8 Author: kkloudas <kkloudas@...> Date: 2018-03-12T11:12:06Z [FLINK-8928] [QS] Improve server binding error message. commit 67b6d7ad2d128a14e001afc34eb14cd6c62d90c4 Author: kkloudas <kkloudas@...> Date: 2018-03-09T21:47:35Z [FLINK-8802] [QS] Fix concurrent access to non-duplicated serializers. commit b86657f630363e59971edd29464130c62bd4b3a7 Author: kkloudas <kkloudas@...> Date: 2018-03-12T12:19:23Z [FLINK-8926] [QS] Shutdown client proxy after test ends. ---- > Concurrent serialization without duplicating serializers in state server. > ------------------------------------------------------------------------- > > Key: FLINK-8802 > URL: https://issues.apache.org/jira/browse/FLINK-8802 > Project: Flink > Issue Type: Bug > Components: Queryable State > Affects Versions: 1.5.0 > Reporter: Kostas Kloudas > Assignee: Kostas Kloudas > Priority: Blocker > Fix For: 1.5.0 > > > The `getSerializedValue()` may be called by multiple threads but serializers > are not duplicated, which may lead to exceptions thrown when a serializer is > stateful. -- This message was sent by Atlassian JIRA (v7.6.3#76005)