apache / apache/dubbo

AbstractConfig中equals方法不比较id导致找不到registry

Open
#12,159 2 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.1.9
* Java version: 1.8

### Steps to reproduce this issue

1. A和B两个项目client定义同样的registry内容,定义不同的id,A和B两个client中分别定义了几个consumer,使用不同的registry id
2. C项目同时引用了A和B两个client,启动时就会报错找不到A或B其中一个registry
3. 原因是AbstractConfigManager的165行判断value.equals(config)时,equals方法中不比较id。为什么要忽略id的对比?

Pls. provide [GitHub address] to reproduce this issue.

### Expected Behavior

如果没有其他特殊逻辑,equals比较id这个重要属性,允许不同项目配置相同内容而不同id的registry

### Actual Behavior

![image](https://user-images.githubusercontent.com/3276231/233576487-00e91b13-9713-47f3-bcf3-c1b556bb84a6.png)

If there is an exception, please attach the exception trace:

```
Just put your stack trace here!
```

Contributor guide

Open the contributing guide

Research direction

Start by inspecting AbstractConfigManager around line 165 and the equals implementation in AbstractConfig. Trace how registry configurations are compared when two clients define identical registry contents with different ids. Done means distinct registry ids no longer collapse into one configuration and the lookup succeeds for both registries.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.