HeartSaVioR opened a new pull request #25753: [SPARK-29046] Fix NPE in 
SQLConf.get when active SparkContext is stopping
URL: https://github.com/apache/spark/pull/25753
 
 
   # What changes were proposed in this pull request?
   
   This patch fixes the bug regarding NPE in SQLConf.get, which is only 
possible when SparkContext._dagScheduler is null due to stopping SparkContext. 
The logic doesn't seem to consider active SparkContext could be in progress of 
stopping.
   
   Note that it can't be encountered easily as `SparkContext.stop()` blocks the 
main thread, but there're some cases where users run another threads, and 
listener is accessing SQLConf.get after dagScheduler is set to null (this is 
the case what I encountered.)
   
   ### Why are the changes needed?
   
   The bug brings NPE.
   
   ### Does this PR introduce any user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added new UT to verify NPE doesn't occur. Without patch, the test fails with 
throwing NPE.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to