Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5636#discussion_r29462292
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/Stage.scala ---
    @@ -70,6 +70,26 @@ private[spark] abstract class Stage(
       /** Pointer to the latest [StageInfo] object, set by DAGScheduler. */
       var latestInfo: StageInfo = StageInfo.fromStage(this)
     
    +  // The maximum number of times to retry a stage before aborting 
    +  private[scheduler] val maxStageFailures = 4
    +  
    +  // Spark is resilient to executors dying by retrying stages on 
FetchFailures. This counter ensures
    +  // that we don't retry stages indefinitely by aborting the stage if it 
fails too many times. 
    +  private var failCount = 0
    +  private[scheduler] def fail() : Unit = { failCount += 1 }
    +  private[scheduler] def shouldAbort(): Boolean = { failCount >= 
maxStageFailures }
    +  private[scheduler] def clearFailures() : Unit = { failCount = 0 }
    +
    +  /**
    +   * Check whether we should abort the failedStage due to multiple 
failures.
    +   * This method updates the running count of failures for a particular 
stage and returns 
    +   * true if the number of failures exceeds the allowable number of 
failures.
    +   */
    +  private[scheduler] def failAndShouldAbort(): Boolean = {
    +    fail()
    +    shouldAbort()
    --- End diff --
    
    can you inline those two functions here?  I don't see much value in 
separating them out


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

Reply via email to