srowen commented on a change in pull request #25308: [SPARK-28576][SQL] fix the 
dead lock issue when enable new adaptive execution
URL: https://github.com/apache/spark/pull/25308#discussion_r310204436
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkPlan.scala
 ##########
 @@ -239,15 +240,26 @@ abstract class SparkPlan extends QueryPlan[SparkPlan] 
with Logging with Serializ
     }
   }
 
+  /**
+  * Here use the ReentrantLock instead of synchronized to prevent the dead lock
+  * cause by lazy operator.
+  */
+  private val lock = new ReentrantLock()
+
   /**
    * Blocks the thread until all subqueries finish evaluation and update the 
results.
    */
-  protected def waitForSubqueries(): Unit = synchronized {
-    // fill in the result of subqueries
-    runningSubqueries.foreach { sub =>
-      sub.updateResult()
+  protected def waitForSubqueries(): Unit = {
 
 Review comment:
   Is it not sufficient to just mark this `synchronized`? is the idea that it 
would interfere with other synchronization on this instance object?

----------------------------------------------------------------
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