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/04/18 08:32:48 UTC

[GitHub] [spark] uncleGen commented on a change in pull request #24400: [SPARK-27503][DStream] JobGenerator thread exit for some fatal errors but application keeps running

uncleGen commented on a change in pull request #24400: [SPARK-27503][DStream] JobGenerator thread exit for some fatal errors but application keeps running
URL: https://github.com/apache/spark/pull/24400#discussion_r276565965
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/util/EventLoop.scala
 ##########
 @@ -100,7 +100,11 @@ private[spark] abstract class EventLoop[E](name: String) extends Logging {
    * Put the event into the event queue. The event thread will process it later.
    */
   def post(event: E): Unit = {
-    eventQueue.put(event)
+    if (eventThread.isAlive && !stopped.get) {
+      eventQueue.put(event)
+    } else {
+      onError(new IllegalStateException(s"$name has already been stopped."))
+    }
 
 Review comment:
   here we only need to report thread stopped. There is no exception messages, but it is fine because thread will throw exception when exit.

----------------------------------------------------------------
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.
 
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