spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BryanCutler <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-13602][CORE] Add shutdown hook to Drive...
Date Fri, 25 Mar 2016 04:35:47 GMT
Github user BryanCutler commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11746#discussion_r57418729
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala ---
    @@ -68,56 +71,67 @@ private[deploy] class DriverRunner(
     
       private var clock: Clock = new SystemClock()
       private var sleeper = new Sleeper {
    -    def sleep(seconds: Int): Unit = (0 until seconds).takeWhile(f => {Thread.sleep(1000);
!killed})
    +    def sleep(seconds: Int): Unit = Thread.sleep(seconds * 1000)
       }
     
       /** Starts a thread to run and manage the driver. */
       private[worker] def start() = {
    -    new Thread("DriverRunner for " + driverId) {
    +    workerThread = new Thread("DriverRunner for " + driverId) {
           override def run() {
             try {
    -          val driverDir = createWorkingDirectory()
    -          val localJarFilename = downloadUserJar(driverDir)
    -
    -          def substituteVariables(argument: String): String = argument match {
    -            case "{{WORKER_URL}}" => workerUrl
    -            case "{{USER_JAR}}" => localJarFilename
    -            case other => other
    +          shutdownHook = ShutdownHookManager.addShutdownHook { () =>
    +            killProcessAndFinalize(DriverState.KILLED, new SparkException("Worker shutting
down"))
    --- End diff --
    
    Yeah, you're right, I should have seen that.. I'll fix that up.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message