Repository navigation
[SPARK-44462][FOLLOWUP][SS][CONNECT] Assert foreachBatch close() unregisters the cloned session - #59202
Closed
LuciferYang wants to merge 1 commit into
Closed
[SPARK-44462][FOLLOWUP][SS][CONNECT] Assert foreachBatch close() unregisters the cloned session#59202LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
(cherry picked from commit 686c566)
Contributor
Author
|
cc @HyukjinKwon |
HyukjinKwon
approved these changes
Oct 2, 2026
uros-b
approved these changes
Oct 2, 2026
uros-b
left a comment
Member
There was a problem hiding this comment.
Thank you for following up on this!
LuciferYang
added a commit
that referenced
this pull request
Oct 2, 2026
…gisters the cloned session ### What changes were proposed in this pull request? Followup to #55410. The two `ForeachBatchSessionManager` cleanup tests in `StreamingForeachBatchHelperSuite` checked that `close()` is terminal and that the registered cleaner runs, but neither asserted the side effect `close()` exists to guarantee: that the cloned `SessionHolder` is removed from `SparkConnectService.sessionManager`. Because `close()` sets its `closed` flag independently of the `closeSession` call, a future change that dropped or broke the unregister step would still pass both tests while re-introducing the never-expiring-holder leak. This adds assertions that the cloned `SessionKey` is present in the session manager before `close()` and absent after. ### Why are the changes needed? To make the cloned-session leak-prevention contract regression-sensitive. Spotted in review of #59200, the branch-4.3 backport. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass GitHub Actions. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code Closes #59202 from LuciferYang/SPARK-44462-assert-cloned-session-unregister. Lead-authored-by: YangJie <yangjie01@baidu.com> Co-authored-by: reviewer <reviewer@local> Signed-off-by: yangjie01 <yangjie01@baidu.com> (cherry picked from commit 38422ae) Signed-off-by: yangjie01 <yangjie01@baidu.com>
Contributor
Author
Contributor
Author
|
Thank you @HyukjinKwon @uros-b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Followup to #55410. The two
ForeachBatchSessionManagercleanup tests inStreamingForeachBatchHelperSuitechecked thatclose()is terminal and that the registered cleaner runs, but neither asserted the side effectclose()exists to guarantee: that the clonedSessionHolderis removed fromSparkConnectService.sessionManager. Becauseclose()sets itsclosedflag independently of thecloseSessioncall, a future change that dropped or broke the unregister step would still pass both tests while re-introducing the never-expiring-holder leak. This adds assertions that the clonedSessionKeyis present in the session manager beforeclose()and absent after.Why are the changes needed?
To make the cloned-session leak-prevention contract regression-sensitive. Spotted in review of #59200, the branch-4.3 backport.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass GitHub Actions.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code