Skip to content

Commit

Permalink
[FLINK-27223][python] Fix the state access problem when python.state.…
Browse files Browse the repository at this point in the history
…cache-size is set to 0

This closes apache#19457.
  • Loading branch information
dianfu committed Apr 14, 2022
1 parent 6155b3a commit eee8804
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flink-python/pyflink/fn_execution/state_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def get_internal_state(self):
return self._internal_state

def _maybe_clear_write_cache(self):
if self._cache_type == SynchronousKvRuntimeState.CacheType.DISABLE_CACHE:
if self._cache_type == SynchronousKvRuntimeState.CacheType.DISABLE_CACHE or \
self._remote_state_backend._state_cache_size <= 0:
self._internal_state.commit()
self._internal_state._cleared = False
self._internal_state._added_elements = []
Expand Down

0 comments on commit eee8804

Please sign in to comment.