Skip to content

ForkingClusterInvoker missing RpcContext and the attachments. #2023

@carryxyh

Description

@carryxyh
  • 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.7.0-SNAPSHOT
  • Operating System version: mac os
  • Java version: 1.8

Step to reproduce this issue

  1. Export a service
  2. Make cluster = "forking"
  3. Set Attachment in RpcContext
  4. Do rpc invoke

Expected Result

The attachment in RpcContext has element.

Actual Result

The attachment in RpcContext don't have element.

The problem

I set attachment in the consumer side like this:
image

Then do rpc invoke,but the attachment is missing, (AbstractInvoker#invoke):
image

The problem is that ForkingClusterInvoker use threapool to do rpc invoke which will miss the threadlocal:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions