You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/22 13:06:22 UTC

[GitHub] gaborgsomogyi commented on a change in pull request #23156: [SPARK-24063][SS] Add maximum epoch queue threshold for ContinuousExecution

gaborgsomogyi commented on a change in pull request #23156: [SPARK-24063][SS] Add maximum epoch queue threshold for ContinuousExecution
URL: https://github.com/apache/spark/pull/23156#discussion_r259333569
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousExecution.scala
 ##########
 @@ -390,6 +398,41 @@ class ContinuousExecution(
     }
   }
 
+  /**
+   * Stores error and stops the query execution thread to terminate the query in new thread.
+   */
+  def stopInNewThread(error: Throwable): Unit = {
+    failureLock.synchronized {
+      failure match {
+        case None =>
+          logError(s"Query $prettyIdString received exception $error")
+          failure = Some(error)
+          stopInNewThread()
+        case _ =>
+          // Stop already initiated
+      }
+    }
+  }
+
+  /**
+   * Stops the query execution thread to terminate the query in new thread.
+   */
+  private def stopInNewThread(): Unit = {
+    new Thread("stop-continuous-execution") {
 
 Review comment:
   Before I've created this PR checked this function but not used because of the join. I've considered to modify it by adding a `shouldJoin` parameter with default `true` but always afraid of changing such core parts. If you think it worth it can be done though.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org