-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Closed
Labels
component/need-triageNeed maintainers to triageNeed maintainers to triagetype/need-triageNeed maintainers to triageNeed maintainers to triage
Description
Pre-check
- I am sure that all the content I provide is in English.
Search before asking
- I had searched in the issues and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo 3.2.5
Jdk 1.8
Linux
Steps to reproduce this issue
- Manually perform some service registrations, such as registering one service every 10 seconds, for a total of 20 registrations.
- Wait for about 5 minutes, and the CPU usage will reach 100%.
What you expected to happen
Without any abnormal conditions, the CPU usage will not reach 100%.
Anything else
The reason is likely that the following code has entered an infinite loop.
// org.apache.dubbo.registry.client.AbstractServiceDiscovery
while (metadataInfos.size() > metadataInfoCacheSize) {
AtomicReference<String> oldestRevision = new AtomicReference<>();
AtomicReference<MetadataInfoStat> oldestStat = new AtomicReference<>();
metadataInfos.forEach((k, v) -> {
if (System.currentTimeMillis() - v.getUpdateTime() > metadataInfoCacheExpireTime &&
(oldestStat.get() == null || oldestStat.get().getUpdateTime() > v.getUpdateTime())) {
oldestRevision.set(k);
oldestStat.set(v);
}
});
if (oldestStat.get() != null) {
metadataInfos.remove(oldestRevision.get(), oldestStat.get());
}
}
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
component/need-triageNeed maintainers to triageNeed maintainers to triagetype/need-triageNeed maintainers to triageNeed maintainers to triage
Type
Projects
Status
Done