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

    https://github.com/apache/spark/pull/7014#discussion_r35478432
  
    --- Diff: core/src/main/scala/org/apache/spark/TaskEndReason.scala ---
    @@ -97,13 +103,27 @@ case class ExceptionFailure(
         description: String,
         stackTrace: Array[StackTraceElement],
         fullStackTrace: String,
    -    metrics: Option[TaskMetrics])
    +    metrics: Option[TaskMetrics],
    +    exceptionWrapper: Option[ThrowableSerializationWrapper])
       extends TaskFailedReason {
     
    +  /**
    +   * `preserveCause` is used to keep the exception itself so it is 
available to the
    +   * driver. This may be set to `false` in the event that the exception is 
not in fact
    +   * serializable.
    +   */
    +  private[spark] def this(e: Throwable, metrics: Option[TaskMetrics], 
preserveCause: Boolean) {
    +    this(e.getClass.getName, e.getMessage, e.getStackTrace, 
Utils.exceptionString(e), metrics,
    +      if (preserveCause) Some(new ThrowableSerializationWrapper(e)) else 
None)
    +  }
    +
       private[spark] def this(e: Throwable, metrics: Option[TaskMetrics]) {
    -    this(e.getClass.getName, e.getMessage, e.getStackTrace, 
Utils.exceptionString(e), metrics)
    +    this(e, metrics, preserveCause = true)
       }
     
    +  def exception = exceptionWrapper.flatMap(
    +    (w : ThrowableSerializationWrapper) => Option(w.exception))
    --- End diff --
    
    nit: needs a return type, and if multiline wrap in braces.  Though you 
could also do `exceptionWrapper.flatMap(Option(_.exception))` which might 
eliminate the need for multiple lines


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