Skip to content

Commit

Permalink
TEZ-4555: Fail fast in LocalClient if the dirs (log, local) haven't b…
Browse files Browse the repository at this point in the history
…een created (#348). (Laszlo Bodor, reviewed by Ayush Saxena)
  • Loading branch information
abstractdog authored Apr 25, 2024
1 parent f080031 commit b5b6226
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,17 @@ public void run() {
// Prepare Environment
Path logDir = new Path(userDir, "localmode-log-dir");
Path localDir = new Path(userDir, "localmode-local-dir");
localFs.mkdirs(logDir);
localFs.mkdirs(localDir);

// fail fast if the local directories (on the paths that were used on HDFS) cannot be created
// in this case, user might want to choose a different staging path, which works on the local FS too
if (!localFs.mkdirs(logDir)) {
throw new IOException(
"Unable to create log directory, try to create it manually for further insights: " + logDir);
}
if (!localFs.mkdirs(localDir)) {
throw new IOException(
"Unable to create local directory, try to create it manually for further insights: " + localDir);
}

UserGroupInformation.setConfiguration(conf);
// Add session specific credentials to the AM credentials.
Expand Down

0 comments on commit b5b6226

Please sign in to comment.