Joy-2000 commented on code in PR #19432:
URL: https://github.com/apache/hudi/pull/19432#discussion_r3688422700


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/StreamWriteOperatorCoordinator.java:
##########
@@ -254,8 +254,12 @@ public void start() throws Exception {
       }
       restoreEvents(Long.MAX_VALUE);
     } catch (Throwable throwable) {
-      log.error("Failed to start operator coordinator.", throwable);
-      context.failJob(throwable);
+      // Rethrow instead of context.failJob(): failJob triggers an in-graph 
global failover that
+      // keeps this same coordinator instance alive without calling start() 
again, leaving the
+      // half-initialized null fields (executor, writeClient, metaClient ...) 
to be reused and NPE
+      // later. Rethrowing surfaces the failure as a JobMaster start failure 
so the partially
+      // initialized instance is discarded rather than kept serving.
+      throw new HoodieException("Failed to start operator coordinator.", 
throwable);

Review Comment:
   `OperatorCoordinatorHolder.start()` delegates to `coordinator.start()`, and 
`DefaultOperatorCoordinatorHandler.startOperatorCoordinators(...)` catches 
startup failures and calls `coordinators.forEach(IOUtils::closeQuietly)` before 
rethrowing a `FlinkRuntimeException` for non-fatal failures.



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