EricJoy2048 commented on code in PR #2904:
URL: 
https://github.com/apache/incubator-seatunnel/pull/2904#discussion_r980911692


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceReader.java:
##########
@@ -58,20 +58,22 @@ public void close() throws IOException {
     @Override
     @SuppressWarnings("magicnumber")
     public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
-        JdbcSourceSplit split = splits.poll();
-        if (null != split) {
-            inputFormat.open(split);
-            while (!inputFormat.reachedEnd()) {
-                SeaTunnelRow seaTunnelRow = inputFormat.nextRecord();
-                output.collect(seaTunnelRow);
+        synchronized (output.getCheckpointLock()) {

Review Comment:
   > Is there any other better way than `synchronized`?
   We have discussed many times, and the current conclusion is to use this 
method



##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/source/JdbcSourceReader.java:
##########
@@ -58,20 +58,22 @@ public void close() throws IOException {
     @Override
     @SuppressWarnings("magicnumber")
     public void pollNext(Collector<SeaTunnelRow> output) throws Exception {
-        JdbcSourceSplit split = splits.poll();
-        if (null != split) {
-            inputFormat.open(split);
-            while (!inputFormat.reachedEnd()) {
-                SeaTunnelRow seaTunnelRow = inputFormat.nextRecord();
-                output.collect(seaTunnelRow);
+        synchronized (output.getCheckpointLock()) {

Review Comment:
   > Is there any other better way than `synchronized`?
   
   We have discussed many times, and the current conclusion is to use this 
method



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