liupc commented on a change in pull request #23650: [SPARK-26728]Make 
rdd.unpersist blocking configurable
URL: https://github.com/apache/spark/pull/23650#discussion_r251198861
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rdd/RDD.scala
 ##########
 @@ -209,13 +210,14 @@ abstract class RDD[T: ClassTag](
    */
   def cache(): this.type = persist()
 
+  private val unpersistBlocking = conf.get(RDD_UNPERSIST_BLOCKING)
   /**
    * Mark the RDD as non-persistent, and remove all blocks for it from memory 
and disk.
    *
    * @param blocking Whether to block until all blocks are deleted.
    * @return This RDD.
    */
-  def unpersist(blocking: Boolean = true): this.type = {
+  def unpersist(blocking: Boolean = unpersistBlocking): this.type = {
 
 Review comment:
   @viirya 
   
   > I'd say that it is controlled by the caller. You can decide to call it 
with blocking=false without using default value.
   Yes, I agree it's controlled by the caller, what we change is only the 
default value, callers can always set the blocking parameter by themselves. 
   
   > I'm not sure if making false as default will affect existing programs. 
After a call to unpersist without blocking parameter, the blocks may still 
exist, will it cause unexpected effect? Like OOM?
   Actually, the blocking just wait until RpcTimeout or throws exception if 
error occurred. we still can not expect the blocks being cleaned up, and users 
may be confusing if an exception is thrown, because in most cases, users don't 
known how to handle this. What's more, users always use rdd.unpersist as 
non-exceptional(no explicit warnings or errors).
   
   I agree with @srowen to make it default to `false`, since it should be rare 
that someone wants to wait for it to unpersist.
   
   I have also checked the commit history, seems there is not special intention 
for this default value.
   
https://github.com/apache/spark/blob/ba5e544461e8ca9216af703033f6b0de6dbc56ec/core/src/main/scala/spark/RDD.scala
 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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