-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spark-2381] stop the streaming application if the receiver job failed #1693
Changes from all commits
f4660c5
3f4a602
22e7821
0a156c5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -272,7 +272,15 @@ class ReceiverTracker(ssc: StreamingContext) extends Logging { | |
|
||
// Distribute the receivers and start them | ||
logInfo("Starting " + receivers.length + " receivers") | ||
ssc.sparkContext.runJob(tempRDD, startReceiver) | ||
try { | ||
ssc.sparkContext.runJob(tempRDD, startReceiver) | ||
} catch { | ||
case e : Throwable => | ||
logError("receiver job crashed, detail:" + e.getStackTraceString) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually there is a better way to report this error. |
||
// find a better way to stop the application ? make other stages depend on tempRdd ? | ||
ssc.stop() | ||
System.exit(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't |
||
} | ||
logInfo("All of the receivers have been terminated") | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scala uses throwable for control flow, so throwable should never be caught in a Scala program. Please catch Exception