Github user aljoscha commented on the issue: https://github.com/apache/flink/pull/5032 I think catching the `ClassCastException` is not the proper way to fix this. This might be masking other (real) bugs that lead to `ClassCastExceptions`. We should detect whether the wrong type is used for accessing a state that was already registered in the part of the code that does this, probably in `AbstractKeyedStateBackend`.
---