Github user jerryshao commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -2474,25 +2478,42 @@ private[spark] class CallerContext(
        val context = "SPARK_" + from + appIdStr + appAttemptIdStr +
          jobIdStr + stageIdStr + stageAttemptIdStr + taskIdStr + 
    +  lazy val conf = new Configuration
        * Set up the caller context [[context]] by invoking Hadoop 
CallerContext API of
        * [[org.apache.hadoop.ipc.CallerContext]], which was added in hadoop 
       def setCurrentContext(): Boolean = {
    -    var succeed = false
    -    try {
    -      // scalastyle:off classforname
    -      val callerContext = 
    -      val Builder = 
    -      // scalastyle:on classforname
    -      val builderInst = 
    -      val hdfsContext = Builder.getMethod("build").invoke(builderInst)
    -      callerContext.getMethod("setCurrent", callerContext).invoke(null, 
    -      succeed = true
    -    } catch {
    -      case NonFatal(e) => logInfo("Fail to set Spark caller context", e)
    +    if (!CallerContext.callerContextSupported) {
    --- End diff --
    Alright, so the main purpose to use this flag is to avoid re-executing the 
codes below. So AFAIK unless we can guarantee the sequentially calling of this 
method, otherwise `callerContextSupported` may introduce concurrent issue, 
especially in `Task` running code. Simultaneously started running tasks will 
possibly get the flag as `true` and executing below code, which makes this flag 
    Also in AM/Client, it will only be called once, so this flag is not used at 
those JVMs.

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:

Reply via email to