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

    https://github.com/apache/spark/pull/5835#discussion_r29546809
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1800,6 +1800,15 @@ private[spark] object Utils extends Logging {
         }
       }
     
    +  lazy val isInInterpreter: Boolean = {
    +    try {
    +      val interpClass = classForName("spark.repl.Main")
    +      interpClass.getMethod("interp").invoke(null) != null
    +    } catch {
    +      case _: ClassNotFoundException => false
    --- End diff --
    
    @andrewor14 @squito please, note the change to the return value I 
introduced on this line guys.
    This is controversial to master 
(https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala#L242)
 where we return `true` in case of getting an exception. Still trying to 
understand why it was done that way. If this was on purpose and had a reason 
behind, I'd be grateful for some piece of explanation.
    
    Since this val now resides in Utils and is therefore presented to the 
public, I am convinced there need to be no confusion around its logic.
    Hope it makes sense what I'm saying. 


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