Github user zsxwing commented on the pull request:
https://github.com/apache/spark/pull/6735#issuecomment-110725471
The issue is that if a closure is cleaned twice, when cleaning the closure
at the second time, the `$outer` of this closure may have already been set to
`null`. Then when we call `instantiateClass` for this closure,
`enclosingObject` will be null because we cannot find a parent
(https://github.com/zsxwing/spark/blob/SPARK-7527/core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala#L264).
Because the compiler always checks the first parameter in the constructor,
so `NullPointerException` is thrown.
Since the code for `Utils.isInInterpreter == false` is not used and nobody
reports any issue, how about just removing it and always using the code for
`Utils.isInInterpreter == true`?
---
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]