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

Connection leak risk when using Nacos data-source | Nacos 数据源 close 存在连接泄漏问题 #2953

Closed
KomachiSion opened this issue Nov 16, 2022 · 1 comment · Fixed by #2962
Labels
area/data-source Issues or PRs related to data-source extension good first issue Good for newcomers kind/bug Category issues or prs related to bug. kind/enhancement Category issues or prs related to enhancement.
Milestone

Comments

@KomachiSion
Copy link

Issue Description

Type: bug report

Describe what happened (or what feature you want)

when com.alibaba.csp.sentinel.datasource.nacos.NacosDataSource init, it will create a new ConfigService and cached it.
But when NacosDataSource close, the ConfigService is not be shutdown so that the connections can threads may be not closed.

Once com.alibaba.csp.sentinel.datasource.nacos.NacosDataSource rebuild, the connection and thread will leak.

Describe what you expected to happen

shutdown ConfigService when com.alibaba.csp.sentinel.datasource.nacos.NacosDataSource close.

Anything else we need to know?

The other and recommended fixed way is re-use the ConfigService for all datasources. Now sentinel will create one connection to nacos for each rule.
In fact, multiple rule can be listened by one ConfigService.

@sczyh30 sczyh30 added kind/bug Category issues or prs related to bug. kind/enhancement Category issues or prs related to enhancement. good first issue Good for newcomers area/data-source Issues or PRs related to data-source extension labels Nov 16, 2022
@sczyh30 sczyh30 changed the title Connection leak risk when use sentinel with nacos Connection leak risk when using Nacos data-source | Nacos 数据源 close 存在连接泄漏问题 Nov 16, 2022
@sczyh30 sczyh30 added this to the v2.0.0 milestone Nov 16, 2022
@sczyh30
Copy link
Member

sczyh30 commented Jan 5, 2023

This has been fixed via #2962, but still to be optimized. Further optimization is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/data-source Issues or PRs related to data-source extension good first issue Good for newcomers kind/bug Category issues or prs related to bug. kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants