slfan1989 commented on code in PR #13795:
URL: https://github.com/apache/iceberg/pull/13795#discussion_r2292619648


##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/maintenance/api/ZkLockFactory.java:
##########
@@ -76,6 +85,11 @@ public ZkLockFactory(
 
   @Override
   public void open() {
+    if (isOpen) {
+      LOG.debug("ZkLockFactory already opened for lockId: {}.", lockId);

Review Comment:
   Thanks for the question!
   
   The `isOpen` check is mainly a defensive guard. In practice, `open()` might 
be called more than once during the lifecycle—for example, if the factory is 
reused across multiple components or initialization paths. In such cases, we 
don’t want to re-initialize the `Curator client` or `SharedCount`, so the flag 
ensures idempotency. Ideally, callers should open only once, but this makes the 
method safe against repeated calls.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to