Skip to content

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

@KomachiSion

Description

@KomachiSion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/data-sourceIssues or PRs related to data-source extensiongood first issueGood for newcomerskind/bugCategory issues or prs related to bug.kind/enhancementCategory issues or prs related to enhancement.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions