Skip to content

触发重试机制时,RpcContext中attachment传递不正确的问题 #513

Closed

Description

@aguang0608

您好,我尝试通过自定义Filter的方式在Consumer和Provider两侧传递一些信息,具体逻辑如下:

ConsumerFilter:

    ...
    UUID traceId = UUID.randomUUID();
    logger.info("traceId = {}", traceId);
    RpcContext.setAttachment("traceId", traceId.toString());
    return invoker.invoke(invocation);
    ...

ProviderFilter:

    ...
    UUID traceId = UUID.fromString(RpcContext.getAttachment("traceId"));
    logger.info("traceId = {}", traceId);
    invoker.invoke(invocation);
    ...

实验过程中,由于Provider端invoke的代码处理较慢,触发了Dubbo的超时重试机制,在一次接口调用中,ConsumerFilter和ProviderFilter的逻辑分别触发了两次;显然,两次实际传递的traceId是不同的,但是在ProviderFilter端,两次收到的traceId是一样的(都是第一次传递过去的值);

Activity

  1. carryxyh commented on Jul 25, 2018

    @carryxyh
    Member

    Invocation is should be the same in once invoke.
    So the traceId to Provider A and Provider B is same.

  2. carryxyh commented on Jul 27, 2018

    @carryxyh
    Member

    Hi, @skygr
    Is there still sth about this issue? If not, we will close this issue soon.
    Waiting for your feedback.

  3. carryxyh commented on Jul 31, 2018

    @carryxyh
    Member

    &READY-TO-CLOSE&

  4. zonghaishang commented on Aug 1, 2018

    @zonghaishang
    Member

    Temporarily closed, can be reopened

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions