Connection leak risk when using Nacos data-source | Nacos 数据源 close 存在连接泄漏问题 #2953
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
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 newConfigService
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
whencom.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
.The text was updated successfully, but these errors were encountered: