Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aguang0608 opened this issue Aug 11, 2017 · 4 comments
Closed

Comments

@aguang0608
Copy link

您好,我尝试通过自定义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是一样的(都是第一次传递过去的值);

@carryxyh
Copy link
Member

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

@carryxyh
Copy link
Member

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

@carryxyh
Copy link
Member

&READY-TO-CLOSE&

@zonghaishang
Copy link
Member

Temporarily closed, can be reopened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants