RamonZhou commented on code in PR #58396:
URL: https://github.com/apache/spark/pull/58396#discussion_r4446132121


##########
python/pyspark/sql/connect/client/core.py:
##########
@@ -2604,14 +2606,13 @@ def _delete_ml_cache(self, cache_ids: List[str], 
evict_only: bool = False) -> Li
             return []
 
     def _on_exit(self) -> None:
-        # If the client has already been explicitly closed, skip all cleanup 
RPCs.
-        # The server-side resources were released by close(); reissuing them 
here
-        # is wasted work and, if the server has since become unreachable, can
-        # block process exit on the gRPC call.
-        if self._closed:
+        # Skip cleanup RPCs if the session is already closed or released.
+        if self._closed or self._session_released:

Review Comment:
   This should also be a separate follow-up since this leak predates this PR.



-- 
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]

Reply via email to