weiqingy opened a new pull request, #666: URL: https://github.com/apache/flink-agents/pull/666
Issue #645 originally described a memory leak in checkpointIdToSeqNums when actionStateStore == null: an unconditional put on the snapshot side paired with a guarded remove on the cleanup side, causing the map to grow unboundedly when durable execution was disabled. That asymmetry was structurally fixed during the DurableExecutionManager extraction in #546, which added a symmetric actionStateStore == null early-return at the top of snapshotLastCompletedSequenceNumbers. The symmetry is now held by two independent conditionals with no test or javadoc tying them together — a future refactor that drops either guard would silently reintroduce the leak. This commit locks the invariant in place: - Add a @VisibleForTesting accessor for checkpointIdToSeqNums mirroring the existing getActionStateStore() precedent. - Add a regression test that, with actionStateStore == null, runs two snapshot + notifyCheckpointComplete cycles and asserts the map stays empty. verifyNoInteractions on the mock KeyedStateBackend additionally proves the snapshot-side early-return fires before any backend access. - Strengthen javadoc on both methods to call out the symmetric guard invariant and cross-link to issue #645. No production behavior change. <!-- * Thank you very much for contributing to Flink Agents. * Please add the relevant components in the PR title. E.g., [api], [runtime], [java], [python], [hotfix], etc. --> <!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. --> Linked issue: #xxx ### Purpose of change <!-- What is the purpose of this change? --> ### Tests <!-- How is this change verified? --> ### API <!-- Does this change touches any public APIs? --> ### Documentation <!-- Do not remove this section. Check the proper box only. --> - [ ] `doc-needed` <!-- Your PR changes impact docs --> - [X] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-included` <!-- Your PR already contains the necessary documentation updates --> -- 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]
