You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "iJIAJIA (via GitHub)" <gi...@apache.org> on 2023/10/11 08:12:25 UTC
[I] provider dubbo.tag override by consumer.tag [dubbo]
iJIAJIA opened a new issue, #13184:
URL: https://github.com/apache/dubbo/issues/13184
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
- [x] 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.2.3
* Operating System version: win10
* Java version: 1.8
### Steps to reproduce this issue
1. 使用nacos作为注册中心
2. provider使用interface register-mode
3. consumer 配置 dubbo.consumer.tag=foo
Pls. provide [GitHub address] to reproduce this issue.
### Expected Behavior
consumer侧报no provider
### Actual Behavior
consumer 请求到了 provider节点
### Reason
实际场景业务场景发生在dubbo3x 服务请求 dubbo2x.
接口级别服务发现时, NacosRegistry有个buildUrl逻辑, 构建的URL实例为org.apache.dubbo.common.url.component.DubboServiceAddressURL
其中getParameter方法为
```
@Override
public String getParameter(String key) {
...
String value = null;
if (consumerURL != null) {'
// consumerURL不为空时优先使用consumer parameter
value = consumerURL.getParameter(key);
}
if (StringUtils.isEmpty(value)) {
value = super.getParameter(key);
}
return value;
}
```
导致 org.apache.dubbo.rpc.cluster.router.tag.TagStateRouter#filterUsingStaticTag 静态tag过滤失效.
```
private <T> BitList<Invoker<T>> filterUsingStaticTag(BitList<Invoker<T>> invokers, URL url, Invocation invocation) {
BitList<Invoker<T>> result;
// Dynamic param
String tag = StringUtils.isEmpty(invocation.getAttachment(TAG_KEY)) ? url.getParameter(TAG_KEY) :
invocation.getAttachment(TAG_KEY);
// Tag request
if (!StringUtils.isEmpty(tag)) {
// 这里进行tag过滤,由于DubboServiceAddressURL#getParameter获取的是consumerURL的tag, 导致过滤失效.
result = filterInvoker(invokers, invoker -> tag.equals(invoker.getUrl().getParameter(TAG_KEY)));
if (CollectionUtils.isEmpty(result) && !isForceUseTag(invocation)) {
result = filterInvoker(invokers, invoker -> StringUtils.isEmpty(invoker.getUrl().getParameter(TAG_KEY)));
}
} else {
result = filterInvoker(invokers, invoker -> StringUtils.isEmpty(invoker.getUrl().getParameter(TAG_KEY)));
}
return result;
}
```
对于应用级别的InstanceAddressURL, 由于有org.apache.dubbo.registry.ProviderFirstParams机制, 可以避免这个情况的发生.
这里想讨论下, 是否可以对DubboServiceAddressURL引入相同的机制. 之前不做修复是有其他的考虑么?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "chickenlj (via GitHub)" <gi...@apache.org>.
chickenlj closed issue #13184: provider dubbo.tag override by consumer.tag
URL: https://github.com/apache/dubbo/issues/13184
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13184:
URL: https://github.com/apache/dubbo/issues/13184#issuecomment-1761206824
It seems that the `CacheableFailbackRegistry#removeParamsFromConsumer` logic of `CacheableFailbackRegistry#toUrlsWithoutEmpty` is not aligned when implementing `NacosRegistry#toUrlWithEmpty`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "iJIAJIA (via GitHub)" <gi...@apache.org>.
iJIAJIA commented on issue #13184:
URL: https://github.com/apache/dubbo/issues/13184#issuecomment-1766068903
> Is there anyone like to fix it?
sorry for miss close
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "iJIAJIA (via GitHub)" <gi...@apache.org>.
iJIAJIA commented on issue #13184:
URL: https://github.com/apache/dubbo/issues/13184#issuecomment-1765865637
> `removeParamsFromConsumer`
has a plan to fix?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "iJIAJIA (via GitHub)" <gi...@apache.org>.
iJIAJIA closed issue #13184: provider dubbo.tag override by consumer.tag
URL: https://github.com/apache/dubbo/issues/13184
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13184:
URL: https://github.com/apache/dubbo/issues/13184#issuecomment-1766025274
Is there anyone like to fix it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [I] provider dubbo.tag override by consumer.tag [dubbo]
Posted by "namelessssssssssss (via GitHub)" <gi...@apache.org>.
namelessssssssssss commented on issue #13184:
URL: https://github.com/apache/dubbo/issues/13184#issuecomment-1766057432
> Is there anyone like to fix it?
Maybe I can try fix it later
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org