You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by mridulm <gi...@git.apache.org> on 2014/03/16 17:12:35 UTC

[GitHub] spark pull request: Bugfixes/improvements to scheduler

GitHub user mridulm opened a pull request:

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

    Bugfixes/improvements to scheduler

    Move the PR#517 of apache-incubator-spark to the apache-spark


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

    $ git pull https://github.com/mridulm/spark master

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

    https://github.com/apache/spark/pull/159.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 #159
    
----
commit fa5d9f15d38f66230c2fdba7e0b82e3936d4cde9
Author: Mridul Muralidharan <mr...@gmail.com>
Date:   2014-03-16T16:09:21Z

    Bugfixes/improvements to scheduler : PR #517

----


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37775955
  
    sounds fair, changed to always blacklist


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mateiz <gi...@git.apache.org>.
Github user mateiz commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-38098061
  
    Actually I'll merge this as is and clean up the small thing above later. Thanks for the patch, Mridul!


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10686136
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    In any case that seems like something for a separate change, and for now @mridulm should just keep it consistent


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37901336
  
    Merged build finished.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10647093
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    This was @markhamstra 's recommendation - private[this] as better than private.



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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-38120611
  
    Great to see this in !
    /CC @tgravescs
    
    
    On Wed, Mar 19, 2014 at 1:38 PM, asfgit <no...@github.com> wrote:
    
    > Closed #159 <https://github.com/apache/spark/pull/159> via ab747d3<https://github.com/apache/spark/commit/ab747d39ddc7c8a314ed2fb26548fc5652af0d74>
    > .
    >
    > --
    > Reply to this email directly or view it on GitHub<https://github.com/apache/spark/pull/159>
    > .
    >


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mateiz <gi...@git.apache.org>.
Github user mateiz commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37789163
  
    Seems like a good idea, but please add the new setting in `docs/configuration.md` as well.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37766083
  
    Ah, capital J @pwendell ? jenkins is indeed very picky :-)


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37903953
  
    Merged build started.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by kayousterhout <gi...@git.apache.org>.
Github user kayousterhout commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37775065
  
    For FetchFailed, the entire task set gets failed anyway and no new tasks
    for that task set will be launched (because the previous stage needs to be
    re-run), so blacklisting the executor won't have any effect.
    
    
    On Sun, Mar 16, 2014 at 4:18 PM, Mridul Muralidharan <
    notifications@github.com> wrote:
    
    > In case of FetchFailed, it does not help to blacklist the executor (since
    > failure was not local to that executor).
    > TaskKilled is something I am unsure of - either is fine I guess. I am not
    > sure in what all circumstances it will get fired; and if any of them can be
    > due to running the task in node issues. Any thoughts ?
    >
    > Note that when the number of executors are reasonably high, blacklisting
    > some for a task would be ok - but when number of executors is low and
    > number of tasks per stage is not too high (or towards end of a stage),
    > aggressively marking executors as failed can slow the stage down a lot from
    > our observation.
    >
    > --
    > Reply to this email directly or view it on GitHub<https://github.com/apache/spark/pull/159#issuecomment-37774958>
    > .
    >


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37769919
  
     Merged build triggered.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10767799
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -245,6 +262,21 @@ private[spark] class TaskSetManager(
       }
     
       /**
    +   * Is this re-execution of a failed task on an executor it already failed in before
    +   * EXECUTOR_TASK_BLACKLIST_TIMEOUT has elapsed ?
    +   */
    +  private def executorIsBlacklisted(execId: String, taskId: Int): Boolean = {
    +    if (failedExecutors.contains(taskId)) {
    +      val failed = failedExecutors.get(taskId).get
    --- End diff --
    
    You can just write this as `failedExectors(taskId)`


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10683261
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    Regarding `private[this]`, we don't really use it elsewhere, so I'd skip it here. It would be a bigger change to convert the whole codebase to `private[this]`. Its main benefit seems to be in terms of code generated but that kind of stuff usually gets inlined anyway.
    
    I now see that this is per-task, not a blacklist for the whole executor, so it makes sense for the variable name to contain "task". In that case maybe call this `spark.scheduler.executorTaskBlacklistTime` -- I think it's good to put "scheduler" as the first component there since it's not really a property of tasks.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37769538
  
    @mridulm not sure if it was the capital or not... jenkins seems stubborn lately.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640748
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -533,8 +575,11 @@ private[spark] class TaskSetManager(
             failureReason = "Lost result for TID %s on host %s".format(tid, info.host)
             logWarning(failureReason)
     
    -      case _ => {}
    +      case _ =>
    +        failureReason = "TID %s on host %s failed for unknown reason".format(tid, info.host)
    --- End diff --
    
    will make default null.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37774958
  
    In case of FetchFailed, it does not help to blacklist the executor (since failure was not local to that executor).
    TaskKilled is something I am unsure of - either is fine I guess. I am not sure in what all circumstances it will get fired; and if any of them can be due to running the task in node issues. Any thoughts ?
    
    Note that when the number of executors are reasonably high, blacklisting some for a task would be ok - but when number of executors is low and number of tasks per stage is not too high (or towards end of a stage), aggressively marking executors as failed can slow the stage down a lot from our observation.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37761392
  
    jenkins test this please


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37762134
  
    Merged build started.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640410
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
    @@ -298,6 +298,94 @@ class TaskSetManagerSuite extends FunSuite with LocalSparkContext with Logging {
         }
       }
     
    +  test("executors should be blacklisted after task failure, in spite of locality preferences") {
    +    val rescheduleDelay = 300L
    +    val conf = new SparkConf().
    +      set("spark.task.executorBlacklistTimeout", rescheduleDelay.toString).
    +      // dont wait to jump locality levels in this test
    +      set("spark.locality.wait", "0")
    +
    +    sc = new SparkContext("local", "test", conf)
    +    // two executors on same host, one on different.
    +    val sched = new FakeTaskScheduler(sc, ("exec1", "host1"),
    +      ("exec1.1", "host1"), ("exec2", "host2"))
    +    // affinity to exec1 on host1 - which we will fail.
    +    val taskSet = FakeTask.createTaskSet(1, Seq(TaskLocation("host1", "exec1")))
    +    // we need actual time measurement
    --- End diff --
    
    remove this comment (since you're using a fake clock -- not the actual clock)


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37901338
  
    One or more automated tests failed
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13225/


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10646975
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    Maybe better to rename this to `spark.scheduler.executorBlacklistTimeout` or just `spark.scheduler.blacklistTimeout`


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37764078
  
    Merged build finished.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37772045
  
    Merged build finished.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37769920
  
    Merged build started.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37772046
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13204/


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10647216
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    Regarding timeout variable name : I was considering a very specific variable name to allow for a better/future approach to handling this issue - and at that time allow us to retire this variable without potential variable name conflicts (spark.scheduler.blacklistTimeout implies a more general black-list handling, which this is not unfortunately); IMO, this is a stop gap solution until we add support for a better black list approach which handles both executors and blocks.
    
    But until we have that, this will atleast unblock us - thankfully, this is not something which a lot of users are hitting (but is fairly common in our case unfortunately).
    
    
    Given this, should we expose this in documentation ?


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10689463
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    Yup, that's entirely reasonable.
    
    And fwiw, I gave the naive replace-all-private-with-private[this] a shot, and it is more complicated than I anticipated.  I may stick with this for a while and may end up with that separate PR -- if for no other reason than that it is turning out to be a somewhat interesting way to probe Spark's internals.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37777315
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13205/


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37777314
  
    Merged build finished.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37764079
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13202/


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10683307
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -71,7 +80,9 @@ private[spark] class TaskSetManager(
       val numTasks = tasks.length
       val copiesRunning = new Array[Int](numTasks)
       val successful = new Array[Boolean](numTasks)
    -  val numFailures = new Array[Int](numTasks)
    +  private val numFailures = new Array[Int](numTasks)
    +  // key is taskId, value is a Map of executor id to when it failed
    +  private[this] val failedExecutors = new HashMap[Int, HashMap[String, Long]]()
    --- End diff --
    
    One small thing, this might be better as a `HashMap[(Int, String), Long]` instead of a HashMap of HashMaps.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640734
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -228,12 +239,18 @@ private[spark] class TaskSetManager(
        * This method also cleans up any tasks in the list that have already
        * been launched, since we want that to happen lazily.
        */
    -  private def findTaskFromList(list: ArrayBuffer[Int]): Option[Int] = {
    -    while (!list.isEmpty) {
    -      val index = list.last
    -      list.trimEnd(1)
    -      if (copiesRunning(index) == 0 && !successful(index)) {
    -        return Some(index)
    +  private def findTaskFromList(execId: String, list: ArrayBuffer[Int]): Option[Int] = {
    +    var indexOffset = list.size
    +
    +    while (indexOffset > 0) {
    +      indexOffset -= 1
    +      val index = list(indexOffset)
    +      if (! executorIsBlacklisted(execId, index)) {
    --- End diff --
    
    so style checker still not in place i guess ... will change


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mateiz <gi...@git.apache.org>.
Github user mateiz commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37789284
  
    Actually one comment on the approach, do we immediately want to blacklist an executor on the first failure or wait until multiple ones? Have you tried both ways? Here I'm assuming that a failure would be fast, but I might be wrong.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10690172
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    1) removed private[this].
    2) renamed property to 'spark.scheduler.executorTaskBlacklistTime'


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10646980
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    Also I'm not sure if it needs to be `private[this]` instead of just `private`; we don't usually use `private[this]`


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640757
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -533,8 +575,11 @@ private[spark] class TaskSetManager(
             failureReason = "Lost result for TID %s on host %s".format(tid, info.host)
             logWarning(failureReason)
     
    -      case _ => {}
    +      case _ =>
    +        failureReason = "TID %s on host %s failed for unknown reason".format(tid, info.host)
         }
    +    // Add to failed for everything else.
    +    addToFailedExecutor()
    --- End diff --
    
    yeah, good catch. I had done a manual merge without looking too much into the change.
    And looks like this codepath in general has been modified a bit since then ... let me see if anything else is also impacted. Thanks !


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37775898
  
    Merged build started.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640471
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -533,8 +575,11 @@ private[spark] class TaskSetManager(
             failureReason = "Lost result for TID %s on host %s".format(tid, info.host)
             logWarning(failureReason)
     
    -      case _ => {}
    +      case _ =>
    +        failureReason = "TID %s on host %s failed for unknown reason".format(tid, info.host)
         }
    +    // Add to failed for everything else.
    +    addToFailedExecutor()
    --- End diff --
    
    It looks like this adds the executor to the list of failed ones in all cases, even for FetchFailed?


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by kayousterhout <gi...@git.apache.org>.
Github user kayousterhout commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37769114
  
    Is there a good reason to not just always blacklist the executor, even in the TaskKilled case?  If the task is killed it may be because the machine is busy, so the blacklist is a good idea, and this will make the code simpler.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37775897
  
     Merged build triggered.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10690206
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -71,7 +80,9 @@ private[spark] class TaskSetManager(
       val numTasks = tasks.length
       val copiesRunning = new Array[Int](numTasks)
       val successful = new Array[Boolean](numTasks)
    -  val numFailures = new Array[Int](numTasks)
    +  private val numFailures = new Array[Int](numTasks)
    +  // key is taskId, value is a Map of executor id to when it failed
    +  private[this] val failedExecutors = new HashMap[Int, HashMap[String, Long]]()
    --- End diff --
    
    When a task is successful, we need to remove all blacklisted executors we know of for that task - moving to key == (Int, String) will mean we will need to iterate over all keys in failedExecutors which can be expensive.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37761904
  
    Jenkins, test this please (?)


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37906513
  
    Merged build finished.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37789635
  
    We only blacklist an executor for a specific task for a short period of time (EXECUTOR_TASK_BLACKLIST_TIMEOUT, not indefinitely). The reason for doing this immediately is to prevent abort of the taskset when it hits maxTaskFailures : the main motivation why we added this was job failures due to this.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640798
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -533,8 +575,11 @@ private[spark] class TaskSetManager(
             failureReason = "Lost result for TID %s on host %s".format(tid, info.host)
             logWarning(failureReason)
     
    -      case _ => {}
    +      case _ =>
    +        failureReason = "TID %s on host %s failed for unknown reason".format(tid, info.host)
         }
    +    // Add to failed for everything else.
    +    addToFailedExecutor()
    --- End diff --
    
    @kayousterhout while going over the changes to that method, I noticed that TaskKilled event does not cause the task to fail anymore, but re-enqueues it as a pending task.
    ditto for FetchFailed.
    
    Do you recall why this behavior was changed ?
    Thanks


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37903952
  
     Merged build triggered.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37899285
  
    Merged build started.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37906516
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/13230/


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10684023
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -59,6 +59,15 @@ private[spark] class TaskSetManager(
       // CPUs to request per task
       val CPUS_PER_TASK = conf.getInt("spark.task.cpus", 1)
     
    +  /*
    +   * Sometimes if an executor is dead or in an otherwise invalid state, the driver
    +   * does not realize right away leading to repeated task failures. If enabled,
    +   * this temporarily prevents a task from re-launching on an executor where
    +   * it just failed.
    +   */
    +  private[this] val EXECUTOR_TASK_BLACKLIST_TIMEOUT =
    +    conf.getLong("spark.task.executorBlacklistTimeout", 0L)
    --- End diff --
    
    Converting the entire codebase to `private[this]` might not be an unreasonable thing to do.  Only in very rare instances does `private[this]` not work where plain `private` does (it wouldn't surprise me if every instance of `private` in Spark could safely be made `private[this]`), and it can provide some performance benefits (not everything that you would expect to get inlined away actually does), so arguably `private[this]` should be the default instead of `private`.
    
    If someone has a few spare cycles, doing the search and replace and running the spark-perf numbers could at least give us some idea of how much we are giving away by using the slightly simpler syntax.  Digging out just when `private[this]` makes a difference would be more work, and maybe not worth doing. 


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37899283
  
     Merged build triggered.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

Posted by mridulm <gi...@git.apache.org>.
Github user mridulm commented on the pull request:

    https://github.com/apache/spark/pull/159#issuecomment-37774984
  
    @pwendell oh ok, i thought i was not being polite enough to jenkins :-)


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10641328
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -533,8 +575,11 @@ private[spark] class TaskSetManager(
             failureReason = "Lost result for TID %s on host %s".format(tid, info.host)
             logWarning(failureReason)
     
    -      case _ => {}
    +      case _ =>
    +        failureReason = "TID %s on host %s failed for unknown reason".format(tid, info.host)
         }
    +    // Add to failed for everything else.
    +    addToFailedExecutor()
    --- End diff --
    
    Yeah the idea here is that if Mesos kills the task (e.g., for fairness reasons) we should try to re-run it.  Job cancellation is handled separately -- and won't result in re-enqueing the task.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

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


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#issuecomment-37762133
  
     Merged build triggered.


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640377
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -228,12 +239,18 @@ private[spark] class TaskSetManager(
        * This method also cleans up any tasks in the list that have already
        * been launched, since we want that to happen lazily.
        */
    -  private def findTaskFromList(list: ArrayBuffer[Int]): Option[Int] = {
    -    while (!list.isEmpty) {
    -      val index = list.last
    -      list.trimEnd(1)
    -      if (copiesRunning(index) == 0 && !successful(index)) {
    -        return Some(index)
    +  private def findTaskFromList(execId: String, list: ArrayBuffer[Int]): Option[Int] = {
    +    var indexOffset = list.size
    +
    +    while (indexOffset > 0) {
    +      indexOffset -= 1
    +      val index = list(indexOffset)
    +      if (! executorIsBlacklisted(execId, index)) {
    --- End diff --
    
    extra space after ! (should be !executorIsBlacklisted)


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640774
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
    @@ -298,6 +298,94 @@ class TaskSetManagerSuite extends FunSuite with LocalSparkContext with Logging {
         }
       }
     
    +  test("executors should be blacklisted after task failure, in spite of locality preferences") {
    +    val rescheduleDelay = 300L
    +    val conf = new SparkConf().
    +      set("spark.task.executorBlacklistTimeout", rescheduleDelay.toString).
    +      // dont wait to jump locality levels in this test
    +      set("spark.locality.wait", "0")
    +
    +    sc = new SparkContext("local", "test", conf)
    +    // two executors on same host, one on different.
    +    val sched = new FakeTaskScheduler(sc, ("exec1", "host1"),
    +      ("exec1.1", "host1"), ("exec2", "host2"))
    +    // affinity to exec1 on host1 - which we will fail.
    +    val taskSet = FakeTask.createTaskSet(1, Seq(TaskLocation("host1", "exec1")))
    +    // we need actual time measurement
    --- End diff --
    
    good point, will do


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

[GitHub] spark pull request: Bugfixes/improvements to scheduler

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

    https://github.com/apache/spark/pull/159#discussion_r10640396
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
    @@ -533,8 +575,11 @@ private[spark] class TaskSetManager(
             failureReason = "Lost result for TID %s on host %s".format(tid, info.host)
             logWarning(failureReason)
     
    -      case _ => {}
    +      case _ =>
    +        failureReason = "TID %s on host %s failed for unknown reason".format(tid, info.host)
    --- End diff --
    
    Can you move this to line 519 instead (or if you prefer, remove the default setting on line 519, which now won't ever be used)


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