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_r276884440
##########
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:
@srowen As these threads are not alive, reporting an error is to do some
cleaning work gracefully. For example, when `JobGenerator` and `JobScheduler`
meet any non fatal error, we will report it to stop streaming context.
Similarly, if them are not alive, we also need to stop streaming context.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]