Github user a-roberts commented on a diff in the pull request:
https://github.com/apache/spark/pull/6740#discussion_r32104008
--- 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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]