This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 620b2f65f0da [SPARK-55362][PYTHON][CONNECT] Don't wait for threadpool 
shutdown
620b2f65f0da is described below

commit 620b2f65f0daed19e1800503df3c892b3bb664e1
Author: Tian Gao <[email protected]>
AuthorDate: Thu Feb 5 08:37:02 2026 +0900

    [SPARK-55362][PYTHON][CONNECT] Don't wait for threadpool shutdown
    
    ### What changes were proposed in this pull request?
    
    In `ExecutePlanResponseReattachableIterator.shutdown`, we need to do 
`threadpool.shutdown(wait=False)` because this method can be triggered in the 
thread pool itself. It can be called in `__del__`.
    
    ### Why are the changes needed?
    
    It's causing deadlock - 
https://github.com/zhengruifeng/spark/actions/runs/21668119904/job/62469352962
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    We have to wait for CI for a few days.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #54145 from gaogaotiantian/fix-deadlock.
    
    Authored-by: Tian Gao <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 python/pyspark/sql/connect/client/reattach.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/python/pyspark/sql/connect/client/reattach.py 
b/python/pyspark/sql/connect/client/reattach.py
index 06a4fe17c29f..2abe95bd2510 100644
--- a/python/pyspark/sql/connect/client/reattach.py
+++ b/python/pyspark/sql/connect/client/reattach.py
@@ -81,7 +81,9 @@ class ExecutePlanResponseReattachableIterator(Generator):
             if cls._release_thread_pool_instance is not None:
                 thread_pool = cls._release_thread_pool_instance
                 cls._release_thread_pool_instance = None
-                thread_pool.shutdown()
+                # This method could be called within the thread pool so don't 
wait for the
+                # shutdown to complete. Otherwise it could deadlock.
+                thread_pool.shutdown(wait=False)
 
     def __init__(
         self,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to