Skip to content
Snippets Groups Projects
  • Alexander Shorin's avatar
    71352c94
    [SPARK-18523][PYSPARK] Make SparkContext.stop more reliable · 71352c94
    Alexander Shorin authored
    ## What changes were proposed in this pull request?
    
    This PR fixes SparkContext broken state in which it may fall if spark driver get crashed or killed by OOM.
    
    ## How was this patch tested?
    
    1. Start SparkContext;
    2. Find Spark driver process and `kill -9` it;
    3. Call `sc.stop()`;
    4. Create new SparkContext after that;
    
    Without this patch you will crash on step 3 and won't be able to do step 4 without manual reset private attibutes or IPython notebook / shell restart.
    
    Author: Alexander Shorin <kxepal@apache.org>
    
    Closes #15961 from kxepal/18523-make-spark-context-stop-more-reliable.
    71352c94
    History
    [SPARK-18523][PYSPARK] Make SparkContext.stop more reliable
    Alexander Shorin authored
    ## What changes were proposed in this pull request?
    
    This PR fixes SparkContext broken state in which it may fall if spark driver get crashed or killed by OOM.
    
    ## How was this patch tested?
    
    1. Start SparkContext;
    2. Find Spark driver process and `kill -9` it;
    3. Call `sc.stop()`;
    4. Create new SparkContext after that;
    
    Without this patch you will crash on step 3 and won't be able to do step 4 without manual reset private attibutes or IPython notebook / shell restart.
    
    Author: Alexander Shorin <kxepal@apache.org>
    
    Closes #15961 from kxepal/18523-make-spark-context-stop-more-reliable.
context.py 41.89 KiB