Github user aarondav commented on the pull request:
https://github.com/apache/spark/pull/607#issuecomment-41990061
Examining the possible patch to the Executor more, it seems less clear that
running the Executor in a doAs is the right solution, because the constructor
of the Executor is run at one point, but then tasks are launched at the request
of an RPC service which is invoked at some later time, after the doAs has
already returned. Since the thread pool is not required to create the child
threads immediately, it's possible that only some of them get the UGI token.
I think my original solution is thus cleaner, as it has the same semantics
as was intended by "only doAs once", but is easily disable-able by a flag and
only incurs the overhead of calling doAs once per task. I am inclined to reopen
this pull request as the "final" solution for 1.0.
---
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.
---