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-35524][cdc-base] Clear connections pools when reader exist. #3388

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

loserwang1024
Copy link
Contributor

Current, inJdbcConnectionPools is static instance, so the datasource pools in it won't be recycle when reader close. It will cause memory leak.

public class JdbcConnectionPools implements ConnectionPools<HikariDataSource, JdbcSourceConfig> {

private static final Logger LOG = LoggerFactory.getLogger(JdbcConnectionPools.class);

private static JdbcConnectionPools instance;
private final Map<ConnectionPoolId, HikariDataSource> pools = new HashMap<>();
private static final Map<String, JdbcConnectionPoolFactory> POOL_FACTORY_MAP = new HashMap<>();

@loserwang1024
Copy link
Contributor Author

Copy link
Contributor

@leonardBang leonardBang left a comment

Choose a reason for hiding this comment

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

Thanks @loserwang1024 for the contribution, could you rebase to latest master?
@ruanhang1993 Would you like to take a look again?

Copy link
Contributor

@ruanhang1993 ruanhang1993 left a comment

Choose a reason for hiding this comment

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

LGTM.

@ruanhang1993 ruanhang1993 merged commit 0c49959 into apache:master Aug 6, 2024
19 checks passed
qiaozongmi pushed a commit to qiaozongmi/flink-cdc that referenced this pull request Sep 23, 2024
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.

4 participants