TakawaAkirayo commented on code in PR #45367:
URL: https://github.com/apache/spark/pull/45367#discussion_r1512107482


##########
core/src/main/scala/org/apache/spark/scheduler/AsyncEventQueue.scala:
##########
@@ -142,9 +142,11 @@ private class AsyncEventQueue(
       eventCount.incrementAndGet()
       eventQueue.put(POISON_PILL)
     }
-    // this thread might be trying to stop itself as part of error handling -- 
we can't join
+    // 1.If the user does not want to wait for the dispatch to end,
+    // they can omit the thread join.
+    // 2.this thread might be trying to stop itself as part of error handling 
-- we can't join
     // in that case.
-    if (Thread.currentThread() != dispatchThread) {
+    if (waitForEventDispatchExit() && Thread.currentThread() != 
dispatchThread) {

Review Comment:
   @beliefer Thanks for the advise! I think use waitForEventDispatchExit is 
more readable here, it's explaining what it does. Using 
LISTENER_BUS_EVENT_QUEUE_WAIT_FOR_EVENT_DISPATCH_EXIT_ON_STOP, you have to jump 
to the place that define this conf to figure out the meaning.



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