[SPARK-52013] [CONNECT] [ML] Remove SparkConnectClient.ml_caches#50832
Closed
WeichenXu123 wants to merge 8 commits into
Closed
[SPARK-52013] [CONNECT] [ML] Remove SparkConnectClient.ml_caches#50832WeichenXu123 wants to merge 8 commits into
SparkConnectClient.ml_caches#50832WeichenXu123 wants to merge 8 commits into
Conversation
HyukjinKwon
approved these changes
May 8, 2025
zhengruifeng
approved these changes
May 8, 2025
dongjoon-hyun
approved these changes
May 8, 2025
Contributor
Author
|
The CI https://github.com/WeichenXu123/spark/actions/runs/14906306045/job/41869504809 |
zhengruifeng
reviewed
May 9, 2025
| # The _cleanup_ml_cache invocation will hang in this test (no valid spark cluster) | ||
| # and it blocks the test process exiting because it is registered as the atexit handler | ||
| # in `SparkConnectClient` constructor. To bypass the issue, patch the method in the test. | ||
| SparkConnectClient._cleanup_ml_cache = lambda _: None |
Contributor
There was a problem hiding this comment.
can we just del this axexit as well?
ml cache is always cleaned when the SessionHolder is closed in the server side.
Contributor
Author
There was a problem hiding this comment.
Is the session ensured to be closed when the client exits or client crashes ? @HyukjinKwon
Contributor
Author
There was a problem hiding this comment.
I think we should do it in follow-up PR, it needs some discussion.
Member
There was a problem hiding this comment.
Is the session ensured to be closed when the client exits or client crashes ?
From what I know, I don't think so
Contributor
Author
|
merged to master |
yhuang-db
pushed a commit
to yhuang-db/spark
that referenced
this pull request
Jun 9, 2025
### What changes were proposed in this pull request? Remove `SparkConnectClient.ml_caches` The current implementation of `SparkConnectClient.ml_caches` is buggy (should be global but it is thread-local) and we already have MLcache dict in Spark driver as the source of truth, we don't need to maintain a copy of the dict in client, so in this PR I remove it. ### Why are the changes needed? Bugfix, and remove redundant data structure. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Unit tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#50832 from WeichenXu123/SPARK-52013-2. Authored-by: Weichen Xu <weichen.xu@databricks.com> Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
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?
Remove
SparkConnectClient.ml_cachesThe current implementation of
SparkConnectClient.ml_cachesis buggy (should be global but it is thread-local)and we already have MLcache dict in Spark driver as the source of truth,
we don't need to maintain a copy of the dict in client,
so in this PR I remove it.
Why are the changes needed?
Bugfix, and remove redundant data structure.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit tests.
Was this patch authored or co-authored using generative AI tooling?
No.