skywalker0618 commented on code in PR #20148:
URL: https://github.com/apache/hudi/pull/20148#discussion_r4141647534


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -476,9 +485,16 @@ private void syncHive() {
    * Sync hoodie table metadata to Hive metastore.
    */
   public void doSyncHive() {
-    try (HiveSyncTool syncTool = hiveSyncContext.hiveSyncTool()) {
-      syncTool.syncHoodieTable();
+    HoodieTimer timer = HoodieTimer.start();
+    try {
+      try (HiveSyncTool syncTool = hiveSyncContext.hiveSyncTool()) {
+        syncTool.syncHoodieTable();
+      }
+    } catch (Throwable t) {
+      hiveSyncMetrics.markSyncFailed(timer.endTimer());
+      throw t;
     }
+    hiveSyncMetrics.markSyncSucceeded(timer.endTimer());

Review Comment:
   Great point, fixed



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to