hudi-agent commented on code in PR #19432:
URL: https://github.com/apache/hudi/pull/19432#discussion_r3687804476
##########
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:
🤖 When `start()` throws here, resources already created earlier in the try
block (e.g. `writeClient`, `metaClient`, and possibly `metadataWriteClient`)
are non-null but not closed. Do you know whether Flink invokes `close()` on a
coordinator instance whose `start()` failed? If not, this path could leak those
clients. It might be worth closing what was initialized before rethrowing.
<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]