-
Notifications
You must be signed in to change notification settings - Fork 183
[FLINK-30371][Connector/JDBC] Fix the problem of JdbcOutputFormat database connection leak #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…abase connection leak
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EchoLee5 Thanks for the PR, is it possible to add a test for this?
…abase connection leak
@MartijnVisser I have added test cases, please help me review the code again, thank you. |
@EchoLee5 Can you please rebase and use the new testing setup? |
@MartijnVisser is there any update on this PR? I can also open a new PR with the fixes from @EchoLee5. |
connectionProvider is configured as final and is AutoClossable which can be used in try(connectionProvider) |
@tamirsagi Is this fix still needed? Or the one i send in? #75 ? |
if you are asking whether its still relevant, then yes. yours is similar. yet, I'd wrap connectionProvider with try after calling #flush because it's cleaner & safer. + I don't see any reason to store an exception to flushException during #close. |
@tamirsagi it is basicly the same fix i asked on the Jira Board and they said i should open up a new PR thats why there are two :) what exactly do you mean by wrapping it? Do you have some example code? |
JdbcOutputFormat#close method add it there
|
Would that get eventually released in the After a database reboot, our Flink job took several minutes to recover from the dead connection. I think this could fix it. Flink 1.20 has also been out for a while, will we have a -1.20 matching serie ? Would it be safe to run the -1.19 jdbc connector serie against Flink 1.20 ? For now we're staying on 1.19 |
Fix the problem of JdbcOutputFormat database connection leak