beliefer commented on code in PR #45367:
URL: https://github.com/apache/spark/pull/45367#discussion_r1512329502
##########
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:
The name of `LISTENER_BUS_EVENT_QUEUE_WAIT_FOR_EVENT_DISPATCH_EXIT_ON_STOP`
have better readability.
It's not worth extract a method used only once too.
--
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]