hudi-agent commented on code in PR #20148:
URL: https://github.com/apache/hudi/pull/20148#discussion_r4141098903
##########
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:
🤖 With `hive_sync.ignore_exceptions=true`, `HiveSyncTool#initSyncClient`
swallows a metastore connection failure and leaves `syncClient` null, and
`syncHoodieTable()` then does nothing. When that happens, this line counts a
success and moves `hiveSyncLastSuccessTimeMs` forward. Should that case count
as a failure, or at least be noted in the metric docs?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]