You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by sitalkedia <gi...@git.apache.org> on 2017/03/30 20:40:52 UTC

[GitHub] spark pull request #17485: [SPARK-20163] Kill all running tasks in a stage i...

GitHub user sitalkedia opened a pull request:

    https://github.com/apache/spark/pull/17485

    [SPARK-20163] Kill all running tasks in a stage in case of fetch failure

    ## What changes were proposed in this pull request?
    
    Currently, the scheduler does not kill the running tasks in a stage when it encounters fetch failure, as a result, we might end up running many duplicate tasks in the cluster. There is already a TODO in TaskSetManager to kill all running tasks which has not been implemented.
    
    ## How was this patch tested?
    
    Unit tests.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sitalkedia/spark kill_tasks_on_stage_failure

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17485.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17485
    
----
commit ec2ac3484330547b4bd7c756ad9123f6c5b2931b
Author: Sital Kedia <sk...@fb.com>
Date:   2017-03-30T20:38:02Z

    [SPARK-20163] Kill all running tasks in a stage in case of fetch failure

----


---
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


[GitHub] spark pull request #17485: [SPARK-20163] Kill all running tasks in a stage i...

Posted by markhamstra <gi...@git.apache.org>.
Github user markhamstra commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17485#discussion_r109174578
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -768,6 +767,19 @@ private[spark] class TaskSetManager(
           s" executor ${info.executorId}): ${reason.toErrorString}"
         val failureException: Option[Throwable] = reason match {
           case fetchFailed: FetchFailed =>
    +        if (!isZombie) {
    +          for (i <- 0 until numTasks if i != index) {
    +            // Only for the first occurance of the fetch failure, kill all running
    +            // tasks in the task set
    +            for (attemptInfo <- taskAttempts(i) if attemptInfo.running) {
    +              sched.backend.killTask(
    +                attemptInfo.taskId,
    +                attemptInfo.executorId,
    +                interruptThread = true,
    --- End diff --
    
    We can do it then, but there is still the question of whether we should do it. That discussion belongs in SPARK-20178.


---
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


[GitHub] spark pull request #17485: [SPARK-20163] Kill all running tasks in a stage i...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/17485


---
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


[GitHub] spark pull request #17485: [SPARK-20163] Kill all running tasks in a stage i...

Posted by sitalkedia <gi...@git.apache.org>.
Github user sitalkedia commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17485#discussion_r109067135
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -768,6 +767,19 @@ private[spark] class TaskSetManager(
           s" executor ${info.executorId}): ${reason.toErrorString}"
         val failureException: Option[Throwable] = reason match {
           case fetchFailed: FetchFailed =>
    +        if (!isZombie) {
    +          for (i <- 0 until numTasks if i != index) {
    +            // Only for the first occurance of the fetch failure, kill all running
    +            // tasks in the task set
    +            for (attemptInfo <- taskAttempts(i) if attemptInfo.running) {
    +              sched.backend.killTask(
    +                attemptInfo.taskId,
    +                attemptInfo.executorId,
    +                interruptThread = true,
    --- End diff --
    
    I see, @markhamstra, does it makes sense to do it only if spark.job.interruptOnCancel is enabled?


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by sitalkedia <gi...@git.apache.org>.
Github user sitalkedia commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    >> see the discussion on the mailing list. We now have 4 different jira for handling fetch failures. I think we should get a design for the entire thing first.
    
    Sure @tgravescs, let me put out a design doc with my initial thoughts on it. 


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by tgravescs <gi...@git.apache.org>.
Github user tgravescs commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    see the discussion on the mailing list.  We now have 4 different jira for handling fetch failures. I think we should get a design for the entire thing first.
    
    personally I don't want to kill the running ones as they have done useful work.


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/75402/
    Test PASSed.


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by sitalkedia <gi...@git.apache.org>.
Github user sitalkedia commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    cc - @kayousterhout, @squito, @tgravescs, @markhamstra 


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    **[Test build #75402 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/75402/testReport)** for PR 17485 at commit [`ec2ac34`](https://github.com/apache/spark/commit/ec2ac3484330547b4bd7c756ad9123f6c5b2931b).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    **[Test build #75402 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/75402/testReport)** for PR 17485 at commit [`ec2ac34`](https://github.com/apache/spark/commit/ec2ac3484330547b4bd7c756ad9123f6c5b2931b).


---
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


[GitHub] spark issue #17485: [SPARK-20163] Kill all running tasks in a stage in case ...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17485
  
    Merged build finished. Test PASSed.


---
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


[GitHub] spark pull request #17485: [SPARK-20163] Kill all running tasks in a stage i...

Posted by markhamstra <gi...@git.apache.org>.
Github user markhamstra commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17485#discussion_r109038854
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -768,6 +767,19 @@ private[spark] class TaskSetManager(
           s" executor ${info.executorId}): ${reason.toErrorString}"
         val failureException: Option[Throwable] = reason match {
           case fetchFailed: FetchFailed =>
    +        if (!isZombie) {
    +          for (i <- 0 until numTasks if i != index) {
    +            // Only for the first occurance of the fetch failure, kill all running
    +            // tasks in the task set
    +            for (attemptInfo <- taskAttempts(i) if attemptInfo.running) {
    +              sched.backend.killTask(
    +                attemptInfo.taskId,
    +                attemptInfo.executorId,
    +                interruptThread = true,
    --- End diff --
    
    That's not valid. We don't know that this can be done safely, which is why spark.job.interruptOnCancel defaults to false. SPARK-17064


---
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