2011aad commented on a change in pull request #18822:
URL: https://github.com/apache/flink/pull/18822#discussion_r809650824
##########
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:
Thanks for reply!
When the first time `flush()` cause an exception, the `flushException` is
set. And the next time `flush()` is called, it will only throw
`RuntimeException("Writing records to JDBC failed.", flushException)` from
`checkFlushException()` without execute real flush logic.
So, the only useful information is recorded in the first exception stack.
And I think there is no need to record the following exceptions.
--
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]