You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "cadeeper (GitHub)" <gi...@apache.org> on 2018/12/17 02:41:30 UTC

[GitHub] [incubator-dubbo] cadeeper opened issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

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

### Environment

* Dubbo version: 2.6.3
* Operating System version: macos
* Java version: 1.8.0

### Steps to reproduce this issue

dubbo服务提供者中使用泛化调用时,绑定attachments时interface错误,导致thrift encode失败:Could not encode request, the specified interface may be incorrect.
1. 调用方调用 interfaceA.methodA方法
2. methodA中通过泛化调用interfaceB.methodB方法
3. attachements中的interface参数为interfaceA,而不是interfaceB

问题出现在AbstractClusterInvoker中的233行:
`
        // binding attachments into invocation.
        Map<String, String> contextAttachments = RpcContext.getContext().getAttachments();
        if (contextAttachments != null && contextAttachments.size() != 0) {
            ((RpcInvocation) invocation).addAttachments(contextAttachments);
        }
`



[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] cadeeper commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "cadeeper (GitHub)" <gi...@apache.org>.
> Seems like this problem will occur whether use thrift protocol or dubbo protocol right ?
> Pls send a simple demo that can reproduce this problem.

@carryxyh  提供了重现demo:
https://github.com/cadeeper/dubbo-thrift-bug-demo/tree/master

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] chickenlj closed issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ issue closed by chickenlj ]

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] qbmiller commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "qbmiller (GitHub)" <gi...@apache.org>.
we have met the same problem, 

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Hello, I don't know about the thrift protocol. I can try to reproduce this problem myself.

1. Consumer invoke interface1
2. in interface1's impl, generic invoke interface2

In this case, the generic invoke will actually call a wrong interface (interface1). Is this what it looks like?

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Seems like this problem will occur whether use thrift protocol or dubbo protocol right ?
Pls send a simple demo that can reproduce this problem.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
@cadeeper 
Ok, I'd like have a look.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] carryxyh commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
Hi, can u provide a demo to reproduce this problem?
I'd like take a look.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] cadeeper commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "cadeeper (GitHub)" <gi...@apache.org>.
不好意思,之后上传demo,目前我查到的原因如下:
AbstractInvoker.java
![image](https://user-images.githubusercontent.com/5336857/50152042-86058180-02fd-11e9-8f6c-6cbcc70b5d4d.png)



[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] carryxyh commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "carryxyh (GitHub)" <gi...@apache.org>.
There is a problem.
Thx for your issue, I will fix it soon.

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo] cadeeper commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "cadeeper (GitHub)" <gi...@apache.org>.
@carryxyh  不好意思,之后上传demo,目前我查到的原因如下:
AbstractInvoker.java
![image](https://user-images.githubusercontent.com/5336857/50152042-86058180-02fd-11e9-8f6c-6cbcc70b5d4d.png)



[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo] cadeeper commented on issue #2981: dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

Posted by "cadeeper (GitHub)" <gi...@apache.org>.
> There is a problem.
> Thx for your issue, I will fix it soon.
好的

[ Full content available at: https://github.com/apache/incubator-dubbo/issues/2981 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org