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

    https://github.com/apache/spark/pull/6740#discussion_r32102447
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDDOperationScope.scala 
---
    @@ -95,17 +95,17 @@ private[spark] object RDDOperationScope extends Logging 
{
       private[spark] def withScope[T](
           sc: SparkContext,
           allowNesting: Boolean = false)(body: => T): T = {
    -    val stackTrace = Thread.currentThread.getStackTrace().tail // ignore 
"Thread#getStackTrace"
    -    val ourMethodName = stackTrace(1).getMethodName // i.e. withScope
    -    // Climb upwards to find the first method that's called something 
different
    -    val callerMethodName = stackTrace
    -      .find(_.getMethodName != ourMethodName)
    +
    +    val callerMethodName = Thread.currentThread.getStackTrace()
    +      .dropWhile(! _.getMethodName().equals("withScope"))
    --- End diff --
    
    I don't think you can hard-code `withScope` here right? it is not 
necessarily the first method after `getStackTrace`. Is it not more 
straightforward to drop calls while the name starts with `getStackTrace`?


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