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

    https://github.com/apache/spark/pull/2609#discussion_r18373175
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala 
---
    @@ -242,7 +267,8 @@ private[spark] class Worker(
               master ! ExecutorStateChanged(appId, execId, manager.state, 
None, None)
             } catch {
               case e: Exception => {
    -            logError("Failed to launch executor %s/%d for 
%s".format(appId, execId, appDesc.name))
    +            logError("Failed to launch executor %s/%d for %s. Caused by 
exception: %s"
    --- End diff --
    
    The second parameter to log* is an exception, which is printed with full 
stack trace, so we should use this instead. Additionally, this code was written 
when Spark was using 2.8 or 2.9, now we can just use string interpolation:
    ```scala
    logError(s"Failed to launch executor $appId/$execId for ${appDesc.name}.", 
e)
    ```
    (The initial "s" activates the string interpolation.)
    
    Additionally, looking on line 276, let's change it to
    ```scala
    master ! ExecutorStateChanged(appId, execId, ExecutorState.FAILED, 
Some(e.toString), None)
    ```


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