tsreaper commented on a change in pull request #18822:
URL: https://github.com/apache/flink/pull/18822#discussion_r809638986



##########
File path: 
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/internal/JdbcOutputFormat.java
##########
@@ -154,7 +154,9 @@ public void open(int taskNumber, int numTasks) throws 
IOException {
                                         try {
                                             flush();
                                         } catch (Exception e) {
-                                            flushException = e;
+                                            if (flushException == null) {
+                                                flushException = e;
+                                            }

Review comment:
       `flush()` may be called multiple times by the timer before the main 
thread discovers the exception and there might actually be multiple exceptions. 
To let users see them all, consider maintaining a list. Make the first 
exception as the cause and the other exceptions as suppressed by calling 
`Throwable#addSuppressed`.




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