sangkyoonnam opened a new pull request, #29601: URL: https://github.com/apache/flink/pull/29601
## What is the purpose of the change In process mode, `ValueState.update(None)` clears the underlying bag and then adds `None` to it instead of leaving the state empty. Flushing that value can fail serialization. `update(None)` should clear the state. See [FLINK-41103](https://issues.apache.org/jira/browse/FLINK-41103). ## Brief change log - `SynchronousValueRuntimeState.update` only adds the value when it is not `None`; the clear and the existing flush policy are unchanged. ## Verifying this change This change added tests and can be verified as follows: - `test_value_state_update_none` in `ProcessDataStreamTests` runs one record per bundle and updates an integer `ValueState` to `1`, then to `None`, then to `2`, reading the value before and after each update. On `master` the job fails with `struct.error: required argument is not an integer` in both the streaming and batch variants; it passes with the change. - `ProcessDataStreamStreamingTests` and `ProcessDataStreamBatchTests` pass locally (64 tests). ## 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): yes, process-mode `ValueState.update`. - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, 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 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) AI was used for the implementation, the verification runs and this description. Generated-by: Claude Code 2.1.308 (Claude Opus 5.5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
