diff options
author | Eyal Zituny <eyal.zituny@equalum.io> | 2017-02-26 15:57:32 -0800 |
---|---|---|
committer | Shixiong Zhu <shixiong@databricks.com> | 2017-02-26 15:57:32 -0800 |
commit | 9f8e392159ba65decddf62eb3cd85b6821db01b4 (patch) | |
tree | 88bcc5a12adcf6248c6f43f04e0abe7c924e1f94 /core/src/main/scala/org | |
parent | 68f2142cfd2ca632a4afb0cc29cc358edbb21f8d (diff) | |
download | spark-9f8e392159ba65decddf62eb3cd85b6821db01b4.tar.gz spark-9f8e392159ba65decddf62eb3cd85b6821db01b4.tar.bz2 spark-9f8e392159ba65decddf62eb3cd85b6821db01b4.zip |
[SPARK-19594][STRUCTURED STREAMING] StreamingQueryListener fails to handle QueryTerminatedEvent if more then one listeners exists
## What changes were proposed in this pull request?
currently if multiple streaming queries listeners exists, when a QueryTerminatedEvent is triggered, only one of the listeners will be invoked while the rest of the listeners will ignore the event.
this is caused since the the streaming queries listeners bus holds a set of running queries ids and when a termination event is triggered, after the first listeners is handling the event, the terminated query id is being removed from the set.
in this PR, the query id will be removed from the set only after all the listeners handles the event
## How was this patch tested?
a test with multiple listeners has been added to StreamingQueryListenerSuite
Author: Eyal Zituny <eyal.zituny@equalum.io>
Closes #16991 from eyalzit/master.
Diffstat (limited to 'core/src/main/scala/org')
-rw-r--r-- | core/src/main/scala/org/apache/spark/util/ListenerBus.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/ListenerBus.scala b/core/src/main/scala/org/apache/spark/util/ListenerBus.scala index 79fc2e9459..fa5ad4e8d8 100644 --- a/core/src/main/scala/org/apache/spark/util/ListenerBus.scala +++ b/core/src/main/scala/org/apache/spark/util/ListenerBus.scala @@ -52,7 +52,7 @@ private[spark] trait ListenerBus[L <: AnyRef, E] extends Logging { * Post the event to all registered listeners. The `postToAll` caller should guarantee calling * `postToAll` in the same thread for all events. */ - final def postToAll(event: E): Unit = { + def postToAll(event: E): Unit = { // JavaConverters can create a JIterableWrapper if we use asScala. // However, this method will be called frequently. To avoid the wrapper cost, here we use // Java Iterator directly. |