Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@cadeeper

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

    }

`

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