Github user tgravescs commented on a diff in the pull request:
https://github.com/apache/spark/pull/15009#discussion_r78005004
--- Diff:
core/src/main/scala/org/apache/spark/launcher/LauncherBackend.scala ---
@@ -29,26 +31,63 @@ import org.apache.spark.util.{ThreadUtils, Utils}
*
* See `LauncherServer` for an explanation of how launcher communication
works.
*/
-private[spark] abstract class LauncherBackend {
+private[spark] abstract class LauncherBackend extends Logging {
private var clientThread: Thread = _
private var connection: BackendConnection = _
private var lastState: SparkAppHandle.State = _
+ private var stopFlag: Boolean = false
@volatile private var _isConnected = false
def connect(): Unit = {
val port = sys.env.get(LauncherProtocol.ENV_LAUNCHER_PORT).map(_.toInt)
val secret = sys.env.get(LauncherProtocol.ENV_LAUNCHER_SECRET)
+ val stopFlag =
sys.env.get(LauncherProtocol.ENV_LAUNCHER_STOP_FLAG).map(_.toBoolean)
if (port != None && secret != None) {
- val s = new Socket(InetAddress.getLoopbackAddress(), port.get)
+ if(stopFlag != None) {
+ connect(port.get, secret.get, stopFlag.get)
+ } else {
+ connect(port.get, secret.get)
+ }
+ }
+ }
+
+ def connect(port: Int, secret: String): Unit = {
+ if (port != None && secret != None) {
--- End diff --
doing the same check here as line 46 above, don't need both.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]