AngersZhuuuu commented on PR #52919:
URL: https://github.com/apache/spark/pull/52919#issuecomment-3500232123

   > Thanks for the fix. But I just wonder why `Awaitable.result()` is not 
interrupted by `cleaningThread.interrupt()`? It should be interruptible 
accodring to the doc:
   > 
   > ```scala
   >   /**
   >    * Await and return the result (of type `T`) of this `Awaitable`.
   >    *
   >    * '''''This method should not be called directly; use [[Await.result]] 
instead.'''''
   >    *
   >    * @param  atMost
   >    *         maximum wait time, which may be negative (no waiting is done),
   >    *         [[scala.concurrent.duration.Duration.Inf Duration.Inf]] for 
unbounded waiting, or a finite positive
   >    *         duration
   >    * @return the result value if the `Awaitable` is completed within the 
specific maximum wait time
   >    * @throws InterruptedException     if the current thread is interrupted 
while waiting
   >    * @throws TimeoutException         if after waiting for the specified 
time this `Awaitable` is still not ready
   >    * @throws IllegalArgumentException if `atMost` is 
[[scala.concurrent.duration.Duration.Undefined Duration.Undefined]]
   >    */
   >   @throws(classOf[TimeoutException])
   >   @throws(classOf[InterruptedException])
   >   def result(atMost: Duration)(implicit permit: CanAwait): T
   > ```
   
   cleaningThread.interrupt() need lock
   ```
   def stop(): Unit = {
     stopped = true
     // Interrupt the cleaning thread, but wait until the current task has 
finished before
     // doing so. This guards against the race condition where a cleaning 
thread may
     // potentially clean similarly named variables created by a different 
SparkContext,
     // resulting in otherwise inexplicable block-not-found exceptions 
(SPARK-6132).
     synchronized {
       cleaningThread.interrupt()
     }
     cleaningThread.join()
     periodicGCService.shutdown()
   }
   ```
   
   but  keepCleaning() holding the lock and wait reply


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to