Jiabao-Sun commented on code in PR #12882:
URL: https://github.com/apache/flink/pull/12882#discussion_r4561311782


##########
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/JdbcBatchingOutputFormat.java:
##########
@@ -219,6 +221,7 @@ public synchronized void close() {
                                        flush();
                                } catch (Exception e) {
                                        LOG.warn("Writing records to JDBC 
failed.", e);
+                                       throw new RuntimeException("Writing 
records to JDBC failed.", e);

Review Comment:
   Hi @leonardBang, please help check this line.
   
   I think this exception is no longer necessary cause delivery is guaranteed 
by flush(), 
   so records still buffered here are only written on a best-effort basis. 
   They are left over when the task failed or was cancelled, typically the very 
batch
   whose flush just failed, and will be replayed from the last checkpoint.
   Since FLINK-38180 https://github.com/apache/flink/pull/26861  (Flink 2.2) an 
exception thrown while cleaning up a
   failed task is fatal and shuts down the whole TaskManager. 
   
   



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