WeichenXu123 commented on code in PR #53485:
URL: https://github.com/apache/spark/pull/53485#discussion_r2625406563
##########
python/pyspark/ml/util.py:
##########
@@ -154,12 +155,16 @@ def add_ref(self) -> None:
self._ref_count += 1
def release_ref(self) -> None:
+ should_del = False
with self._lock:
assert self._ref_count > 0
self._ref_count -= 1
if self._ref_count == 0:
- # Delete the model if possible
- del_remote_cache(self.ref_id)
+ should_del = True
+
+ if should_del:
Review Comment:
Let's add comment that putting `del_remote_cache` within the lock scope
might cause deadlock.
--
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]