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

This reverts commit 3e0a6cf1e0.
This commit is contained in:
Josh Rosen 2015-11-15 22:38:30 -08:00
parent b58765caa6
commit fd50fa4c3e

View file

@ -66,12 +66,15 @@ private[spark] abstract class AsynchronousListenerBus[L <: AnyRef, E](name: Stri
processingEvent = true
}
try {
if (stopped.get()) {
val event = eventQueue.poll
if (event == null) {
// 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
}
val event = eventQueue.poll
assert(event != null, "event queue was empty but the listener bus was not stopped")
postToAll(event)
} finally {
self.synchronized {