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

    https://github.com/apache/spark/pull/1413#discussion_r14916295
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -809,7 +809,11 @@ private[spark] object Utils extends Logging {
        */
       def getCallSite: CallSite = {
         val trace = Thread.currentThread.getStackTrace()
    -      .filterNot(_.getMethodName.contains("getStackTrace"))
    +      .filterNot((ste:StackTraceElement) => 
    +        // When running under some profilers, the current stack trace 
might contain some bogus 
    +        // frames. This Try is intended to ensure that we don't crash in 
these situations by
    +        // ignoring any frames that we can't examine.
    +        Try(ste.getMethodName.contains("getStackTrace")).getOrElse(true))
    --- End diff --
    
    If the only problem was nulls, it's better to filter on null than to add a 
Try here. There's no way String.contains can crash, so it's weird to be using 
Try.


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

Reply via email to