Skip to content
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

[FLINK-35301][cdc] fix deadlock when loading driver classes #3300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Shawn-Hx
Copy link
Contributor

@Shawn-Hx Shawn-Hx commented May 7, 2024

In JDK 8 and earlier version, if multiple threads invoke Class.forName("com.xx.Driver") simultaneously, it may cause jdbc driver deadlock.

FLINK-19435  analyzes this problem.

@@ -43,6 +45,7 @@ public HikariDataSource createPooledDataSource(JdbcSourceConfig sourceConfig) {
config.setMinimumIdle(MINIMUM_POOL_SIZE);
config.setMaximumPoolSize(sourceConfig.getConnectionPoolSize());
config.setConnectionTimeout(sourceConfig.getConnectTimeout().toMillis());
DriverManager.getDrivers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a note for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have added a description in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants