Skip to content

dubbo2.6.2版本oneWay调用造成线程上下文污染传递 #8281

@likefang

Description

@likefang
  • 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.8
  • Operating System version: linux
  • Java version: java8

Steps to reproduce this issue

  1. 调用链为serviceA调用serviceB调用serviceC,整个调用链均为dubbo方式调用
  2. serviceA调用serviceB为oneWay方式调用不关注返回结果,serviceB调用serviceC为正常的dubbo同步调用,但是serviceB获取到serviceC的返回结果为null,而不是包装过的response,造成解析结果时报NPE异常
  3. 验证一:修改serviceA调用servoceB的调用方式为同步调用,问题解决,整个调用链路正常
  4. 验证二:忽略第三步,换另外一种方式验证,在serviceB中添加fitter,清除掉oneWay方式调用的key,整个调用也正常进行
  5. 结论:在dubbo-rpc module中的org.apache.dubbo.rpc.filter.ContextFilter类中清除的Key列表中不包含oneWay方式调用使用的Key(RETURN_KEY)造成oneWay方式的调用一直向下游调用链传递

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!

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