ArkoSharma commented on a change in pull request #1550:
URL: https://github.com/apache/hive/pull/1550#discussion_r499659807



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/ddl/DDLTask.java
##########
@@ -82,8 +89,32 @@ public int execute() {
         throw new IllegalArgumentException("Unknown DDL request: " + 
ddlDesc.getClass());
       }
     } catch (Throwable e) {
+      LOG.error("DDLTask failed", e);
+      int errorCode = ErrorMsg.getErrorMsg(e.getMessage()).getErrorCode();
+      try {
+        ReplicationMetricCollector metricCollector = work.getMetricCollector();
+        if (errorCode > 40000) {
+          //in case of replication related task, dumpDirectory should not be 
null
+          if(work.dumpDirectory != null) {
+            Path nonRecoverableMarker = new Path(work.dumpDirectory, 
ReplAck.NON_RECOVERABLE_MARKER.toString());
+            org.apache.hadoop.hive.ql.parse.repl.dump.Utils.writeStackTrace(e, 
nonRecoverableMarker, conf);
+            if(metricCollector != null){
+              metricCollector.reportStageEnd(getName(), Status.FAILED_ADMIN, 
nonRecoverableMarker.toString());
+            }
+          }
+          if(metricCollector != null){

Review comment:
       In replication flows, dumpDirectory and metricCollector both should be 
non-null. This line considers the corner case where metricCollector might have 
been configured but not dumpDirectory. Still it is a replication case since 
only replication tasks can initialise and pass metricCollector. So we should 
indicate FAILED_ADMIN state at-least (non-recoverable path is null).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to