spuru9 opened a new pull request, #29815:
URL: https://github.com/apache/flink/pull/29815
## What is the purpose of the change
`AppendingState#asyncGet` must complete with `null` for an empty state, and
ForSt does. `TtlListState#asyncGet` wrapped that `null` in an
`AsyncIteratorWrapper`, so with TTL enabled an empty list state gave callers a
non-null iterator whose `onNext`/`isEmpty` threw an NPE, and
`StateFutureUtils#toIterable` failed with a `ClassCastException`.
## Brief change log
- `TtlListState#asyncGet` returns `null` when the inner iterator is `null`,
like the sync `get()` already handles it.
## Verifying this change
- Added `ForStListStateTest#testAsyncGetOnEmptyStateWithTtl`: on a ForSt
backend with TTL, `asyncGet` on a never-written key and after `asyncClear`
completes with `null` and `toIterable` gives an empty list; a non-empty state
still iterates. It fails without the fix (`ClassCastException` in `toIterable`).
## 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, 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)
Generated-by: Claude Code (Claude Opus 5.5)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]