Skip to content

provider gets wrong interface name from attachment when use generic invocation in 2.6.3 #2981

Closed

Description

@cadeeper
  • [*] I have searched the issues of this repository and believe that this is not a duplicate.
  • [*] I have checked the FAQ 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

dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误

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);

    }

`

Activity

  1. carryxyh commented on Dec 17, 2018

    @carryxyh
    Member

    Hi, can u provide a demo to reproduce this problem?
    I'd like take a look.

  2. cadeeper commented on Dec 18, 2018

    @cadeeper
    Author

    @carryxyh 不好意思,之后上传demo,目前我查到的原因如下:
    AbstractInvoker.java
    image

  3. carryxyh commented on Dec 18, 2018

    @carryxyh
    Member

    Seems like this problem will occur whether use thrift protocol or dubbo protocol right ?
    Pls send a simple demo that can reproduce this problem.

  4. cadeeper commented on Dec 19, 2018

    @cadeeper
    Author

    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

  5. carryxyh commented on Dec 19, 2018

    @carryxyh
    Member

    @cadeeper
    Ok, I'd like have a look.

  6. carryxyh commented on Dec 19, 2018

    @carryxyh
    Member

    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?

  7. carryxyh commented on Dec 19, 2018

    @carryxyh
    Member

    There is a problem.
    Thx for your issue, I will fix it soon.

  8. cadeeper commented on Dec 20, 2018

    @cadeeper
    Author

    There is a problem.
    Thx for your issue, I will fix it soon.
    好的

  9. qbmiller commented on Dec 27, 2018

    @qbmiller

    we have met the same problem,

  10. added this to the 2.7.1 milestone on Mar 4, 2019
  11. changed the title [-]dubbo2.6.3 服务提供者中使用泛化调用时,绑定attachments时interface错误[/-] [+]provider gets wrong interface name from attachment when use generic invocation in 2.6.3[/+] on Mar 14, 2019
  12. added a commit that references this issue on Mar 26, 2019
    897b80d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions