spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a-roberts <>
Subject [GitHub] spark pull request: [SPARK-7756] CORE RDDOperationScope fix for IB...
Date Wed, 10 Jun 2015 10:12:58 GMT
Github user a-roberts commented on a diff in the pull request:
    --- 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 --
    The original code captures the stack trace within this method - at line 99, this will
always contain `withScope` as the code comment suggests (unless this method name changes).

    The new code is dropping elements in the stack trace until we see `withScope` and follows
the same logic henceforth. 

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message