This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tez.git


The following commit(s) were added to refs/heads/master by this push:
     new b5b622614 TEZ-4555: Fail fast in LocalClient if the dirs (log, local) 
haven't been created (#348). (Laszlo Bodor, reviewed by Ayush Saxena)
b5b622614 is described below

commit b5b62261497c25d64fbfb9936cba852520ebd3e4
Author: Bodor Laszlo <bodorlaszlo0...@gmail.com>
AuthorDate: Thu Apr 25 12:19:33 2024 +0200

    TEZ-4555: Fail fast in LocalClient if the dirs (log, local) haven't been 
created (#348). (Laszlo Bodor, reviewed by Ayush Saxena)
---
 .../src/main/java/org/apache/tez/client/LocalClient.java    | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java 
b/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
index f6a626e64..bf1cef4c4 100644
--- a/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
+++ b/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java
@@ -331,8 +331,17 @@ public class LocalClient extends FrameworkClient {
           // 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.

Reply via email to