Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Remove timestamp from key to prevent the creation of multiple registries
每次调用getRegistry 都会创建新的Registry.造成会生成大量的HostReactor(里边又有serviceInfoMap),造成内存泄露.
问题的原因是没有删除时间戳(dubbo2 生成的key,不会包含时间戳).
正常使用不会有问题,但是会随着时间的发展oom
NacosRegistryFactory 中的 createRegistryCacheKey 获取的是 toFullString ,因此也不可能过滤(但也可以修改这里)
我们这里修改时间戳,是认为这算一个比较公共的属性
Brief changelog
XXXXX
Verifying this change
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.