Repository: tez
Updated Branches:
refs/heads/branch-0.7 ae3329f87 -> c2794571d
TEZ-2970. Re-localization in TezChild does not use correct UGI. (hitesh)
(cherry picked from commit f23758643f03147dced0b3fdfd11a58b89f83eb7)
Conflicts:
CHANGES.txt
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/c2794571
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/c2794571
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/c2794571
Branch: refs/heads/branch-0.7
Commit: c2794571d631f0a510debd16b4c8bbb016ac6569
Parents: ae3329f
Author: Hitesh Shah <[email protected]>
Authored: Fri Dec 4 14:15:37 2015 -0800
Committer: Hitesh Shah <[email protected]>
Committed: Fri Dec 4 14:17:23 2015 -0800
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../org/apache/tez/runtime/task/TezChild.java | 36 ++++++++++++--------
2 files changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/c2794571/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4cc48b1..733b3e0 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,7 @@ INCOMPATIBLE CHANGES
TEZ-2949. Allow duplicate dag names within session for Tez.
ALL CHANGES
+ TEZ-2970. Re-localization in TezChild does not use correct UGI.
TEZ-2968. Counter limits exception causes AM to crash.
TEZ-2960. Tez UI: Move hardcoded url namespace to the configuration file
TEZ-2947. Tez UI: Timeline, RM & AM requests gets into a consecutive loop in
counters page without any delay
http://git-wip-us.apache.org/repos/asf/tez/blob/c2794571/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
----------------------------------------------------------------------
diff --git
a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
index 7f03992..d2c89d5 100644
---
a/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
+++
b/tez-runtime-internals/src/main/java/org/apache/tez/runtime/task/TezChild.java
@@ -238,7 +238,7 @@ public class TezChild {
FileSystem.clearStatistics();
childUGI = handleNewTaskCredentials(containerTask, childUGI);
- handleNewTaskLocalResources(containerTask);
+ handleNewTaskLocalResources(containerTask, childUGI);
cleanupOnTaskChanged(containerTask);
// Execute the Actual Task
@@ -308,26 +308,34 @@ public class TezChild {
* @throws IOException
* @throws TezException
*/
- private void handleNewTaskLocalResources(ContainerTask containerTask) throws
IOException,
- TezException {
- Map<String, TezLocalResource> additionalResources =
containerTask.getAdditionalResources();
+ private void handleNewTaskLocalResources(ContainerTask containerTask,
+ UserGroupInformation ugi) throws IOException, TezException {
+
+ final Map<String, TezLocalResource> additionalResources =
containerTask.getAdditionalResources();
if (LOG.isDebugEnabled()) {
LOG.debug("Additional Resources added to container: " +
additionalResources);
}
-
if (additionalResources != null && !additionalResources.isEmpty()) {
LOG.info("Localizing additional local resources for Task : " +
additionalResources);
- List<URL> downloadedUrls =
RelocalizationUtils.processAdditionalResources(
- Maps.transformValues(additionalResources, new
Function<TezLocalResource, URI>() {
- @Override
- public URI apply(TezLocalResource input) {
- return input.getUri();
- }
- }), defaultConf, workingDir);
- RelocalizationUtils.addUrlsToClassPath(downloadedUrls);
-
+ try {
+ List<URL> downloadedUrls = ugi.doAs(new
PrivilegedExceptionAction<List<URL>>() {
+ @Override
+ public List<URL> run() throws Exception {
+ return RelocalizationUtils.processAdditionalResources(
+ Maps.transformValues(additionalResources, new
Function<TezLocalResource, URI>() {
+ @Override
+ public URI apply(TezLocalResource input) {
+ return input.getUri();
+ }
+ }), defaultConf, workingDir);
+ }
+ });
+ RelocalizationUtils.addUrlsToClassPath(downloadedUrls);
+ } catch (InterruptedException e) {
+ throw new TezException(e);
+ }
LOG.info("Done localizing additional resources");
}
}