[SPARK-49876][CONNECT] Get rid of global locks from Spark Connect Service#48350
[SPARK-49876][CONNECT] Get rid of global locks from Spark Connect Service#48350ghost wants to merge 1 commit intoapache:masterfrom wvwwvwwv:SPARK-49876-REMOVE-LOCKS
Conversation
There was a problem hiding this comment.
To whom it may concern - I'm pretty sure that this condition was wrong, so fixed it.
There was a problem hiding this comment.
@HyukjinKwon can you please check if the condition was right? as far as I understood, the key was supposed to be removed if no associated entry was found in queryCache. thanks!
There was a problem hiding this comment.
Hm, it has to remove the element within value instead of the whole entry IIRC.
There was a problem hiding this comment.
You're right, and the code actually does that, though it's not quite obvious; value.filter will return true only when value is empty, so semantically the piece of code means,
- Remove elements that do not satisfy
queryCache.containsKey(k)fromvalue. - If
valueis empty after filtering those elements,valuewill be removed fromtaggedQueries.
|
@rangadi Hello, nice to meet you here! This is a minor code optimization as part of an attempt to get rid of the use of global locks in the spark connect service code. Could you review the code please? The code semantics should be the same as before. Thanks. |
|
Merged to master. |
What changes were proposed in this pull request?
Get rid of global locks from Spark Connect Service.
Why are the changes needed?
Spark Connect Service doesn't limit the number of threads, susceptible to priority inversion because of heavy use of global locks.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests + modified an existing test.
Was this patch authored or co-authored using generative AI tooling?
No.