Adamyuanyuan commented on code in PR #10139:
URL: https://github.com/apache/seatunnel/pull/10139#discussion_r2625487935


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceSplitEnumerator.java:
##########
@@ -48,6 +48,14 @@ public class JdbcSourceSplitEnumerator
     private final Context<JdbcSourceSplit> context;
     private final Object stateLock = new Object();
 
+    /**
+     * Indicates whether the enumerator has already notified all registered 
readers that there will
+     * be no more splits. This is used to avoid missing {@code 
NoMoreSplitsEvent} in failover
+     * scenarios where splits are added back via {@link #addSplitsBack(List, 
int)} instead of being
+     * produced via {@link #run()} again.
+     */
+    private boolean noMoreSplitsSignalSent;

Review Comment:
   Good catch — you’re right. `signalNoMoreSplits` is a per-reader one-shot 
event (not retained), so a global `noMoreSplitsSignalSent` can prevent a 
late-registered reader from ever receiving `NoMoreSplitsEvent`. I updated the 
implementation to track which readers have been signaled and only signal newly 
registered readers when the enumerator is finished. Added a unit test to cover 
the late-registration scenario.
   



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