Github user kl0u commented on the issue:
https://github.com/apache/flink/pull/5691
That is because cleaning up the cache is happening from another thread,
other than the one
accessing the serializers, and ThreadLocal does not have a clear() method
that you can call
from another thread and clean all the state in it. Each thread can only
clean its own state.
> On Mar 20, 2018, at 3:34 AM, sihua zhou <[email protected]> wrote:
>
> @sihuazhou commented on this pull request.
>
> In
flink-runtime/src/main/java/org/apache/flink/runtime/state/internal/InternalQueryableKvState.java
<https://github.com/apache/flink/pull/5691#discussion_r175640731>:
>
> > private final boolean areSerializersStateless;
>
> - private final ConcurrentMap<Thread, KvStateInfo<K, N, V>>
serializerCache;
> + private final ConcurrentMap<Thread, KvStateInfo<K, N, V>>
serializerCache = new ConcurrentHashMap<>(4);
>
> nit: just wonder why didn't use ThreadLocal<KvStateInfo<K, N, V>>
provided by JDK...
>
> â
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
<https://github.com/apache/flink/pull/5691#pullrequestreview-105202229>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/ACS1qD3X7x51gg8CHKKLCVJ6aFuOvnthks5tgGqmgaJpZM4SopKO>.
>
---