Skip to content
Snippets Groups Projects
Commit fd50fa4c authored by Josh Rosen's avatar Josh Rosen
Browse files

Revert "[SPARK-11572] Exit AsynchronousListenerBus thread when stop() is called"

This reverts commit 3e0a6cf1.
parent b58765ca
No related branches found
No related tags found
No related merge requests found
...@@ -66,12 +66,15 @@ private[spark] abstract class AsynchronousListenerBus[L <: AnyRef, E](name: Stri ...@@ -66,12 +66,15 @@ private[spark] abstract class AsynchronousListenerBus[L <: AnyRef, E](name: Stri
processingEvent = true processingEvent = true
} }
try { try {
if (stopped.get()) { val event = eventQueue.poll
if (event == null) {
// Get out of the while loop and shutdown the daemon thread // Get out of the while loop and shutdown the daemon thread
if (!stopped.get) {
throw new IllegalStateException("Polling `null` from eventQueue means" +
" the listener bus has been stopped. So `stopped` must be true")
}
return return
} }
val event = eventQueue.poll
assert(event != null, "event queue was empty but the listener bus was not stopped")
postToAll(event) postToAll(event)
} finally { } finally {
self.synchronized { self.synchronized {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment