xi-db opened a new pull request, #53475: URL: https://github.com/apache/spark/pull/53475
### What changes were proposed in this pull request? In current implementation, during the session holder cleanup of non-ML sessions, in mlCache.clear() ([code link](https://github.com/apache/spark/blob/43f7936d7b3a4701e3d0fdb44663006cbe0db70b/sql/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala#L381)) , the offloadedModelsDir is also eagerly created and will need to be deleted, which will cause ~10 ms unnecessary latency. In this PR, we are making the directory creation lazy to avoid deleting empty directories when there is no SparkML operations on the session. ### Why are the changes needed? Improve the performance of ReleaseSession RPC by ~10ms. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? New test and existing tests. ### Was this patch authored or co-authored using generative AI tooling? No. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
