AngersZhuuuu commented on a change in pull request #35594:
URL: https://github.com/apache/spark/pull/35594#discussion_r811820956
##########
File path: core/src/main/scala/org/apache/spark/SparkContext.scala
##########
@@ -2059,7 +2059,20 @@ class SparkContext(config: SparkConf) extends Logging {
/**
* Shut down the SparkContext.
*/
- def stop(): Unit = {
+ def stop(): Unit = stop(0)
+
+ /**
+ * Shut down the SparkContext with exit code that will passed to scheduler
backend.
+ * In client mode, client side may call `SparkContext.stop()` to clean up
but exit with
+ * code not equal to 0. This behavior cause resource scheduler such as
`ApplicationMaster`
+ * exit with success status but client side exited with failed status. Spark
can call
+ * this method to stop SparkContext and pass client side correct exit code
to scheduler backend.
+ * Then scheduler backend should send the exit code to corresponding
resource scheduler
+ * to keep consistens.
Review comment:
Done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]