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

2017-04-24 Thread asfgit
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



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

2017-03-31 Thread markhamstra
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



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

2017-03-30 Thread sitalkedia
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



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

2017-03-30 Thread markhamstra
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



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

2017-03-30 Thread sitalkedia
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 
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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