Open benko233 opened 4 months ago
If provide version, the invoker in pathResolver must have non-equal serviceKey and interfaceName. At this scenario, all overridings fail.
I think more reasonable to compare url.getServiceKey()
with previous.getUrl().getServiceKey()
at TripleProtocol#export
.
@Override
public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
// ...
Invoker<?> previous = pathResolver.add(url.getServiceKey(), invoker);
if (previous != null) {
if (url.getServiceKey().equals(previous.getUrl().getServiceKey())) {
logger.info("Already exists an invoker[" + previous.getUrl() + "] on path[" + url.getServiceKey()
+ "], dubbo will override with invoker[" + url + "]");
} else {
throw new IllegalStateException("Already exists an invoker[" + previous.getUrl() + "] on path[" +
url.getServiceKey() + "], failed to add invoker[" + url +
"] , please use unique serviceKey.");
}
}
// ...
}
Currently, Triple not support reExport. We should fix it in the future
Pre-check
Search before asking
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
3.2.14
Steps to reproduce this issue
step 1. add dynamic configuration like this
step 2. Provider throws an IllegalStateException in TripleProtocol#export because serviceKey contains version while interfaceName does not.
What you expected to happen
Why compare serviceKey with interfaceName here? Why not compare serviceKey with provious's serviceKey?
Anything else
Are you willing to submit a pull request to fix on your own?
Code of Conduct