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

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


The following commit(s) were added to refs/heads/master by this push:
     new 64e944c3f52 [MINOR] Propagate failed cleaner status to RM (#8583)
64e944c3f52 is described below

commit 64e944c3f520f396bc797d739b1c2af3bb43a9ae
Author: haggy <[email protected]>
AuthorDate: Fri Jul 7 22:25:52 2023 -0400

    [MINOR] Propagate failed cleaner status to RM (#8583)
---
 .../main/java/org/apache/hudi/utilities/HoodieCleaner.java  | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCleaner.java 
b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCleaner.java
index f6004d11dc3..ca4524f5769 100644
--- a/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCleaner.java
+++ b/hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieCleaner.java
@@ -108,12 +108,23 @@ public class HoodieCleaner {
 
     String dirName = new Path(cfg.basePath).getName();
     JavaSparkContext jssc = UtilHelpers.buildSparkContext("hoodie-cleaner-" + 
dirName, cfg.sparkMaster);
+    boolean success = true;
+
     try {
       new HoodieCleaner(cfg, jssc).run();
     } catch (Throwable throwable) {
-      LOG.error("Fail to run cleaning for " + cfg.basePath, throwable);
+      success = false;
+      LOG.error("Failed to run cleaning for " + cfg.basePath, throwable);
     } finally {
       jssc.stop();
     }
+
+    if (!success) {
+      // Return a non-zero exit code to properly notify any resource manager
+      // that cleaning was not successful
+      System.exit(1);
+    }
+
+    LOG.info("Cleaner ran successfully");
   }
 }

Reply via email to