Skip to content

未及时释放FutureContext造成频繁GC问题 #12493

@xlq20080808

Description

@xlq20080808
  • I have searched the issues of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 3.0.12 3.1.8
  • Java version: 1.8

Steps to reproduce this issue

  1. consumer及provider 通过环境变量,设置参数 future.sync.set=false
  2. provider返回的报文较大
  3. 3.0.12版本的调用,dubbo协议不会产生频繁GC问题,triple会产生
  4. 3.1.8版本调用,dubbo协议及triple协议都会产生频繁GC问题

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

Expected Behavior

Consumer通过dubbo或triple请求,设置了future.sync.set=false 不会在IntenalThreadLocal中保存返回结果,不再产生频繁GC问题

Actual Behavior

统一设置了参数 future.sync.set=false
3.0.12版本:

Dubbo协议调用

及时清除了FutureContext,生效原因
image
并在之后响应过程中清除了FutureContext
image
且因参数future.sync.set=false 之后也不再设置FutureContext,从而能够解决频发GC的情况

Tiple协议调用

Tiple未及时清除了FutureContext原因
image
且没有在接收到响应后清除InternalThreadLocal
虽参数future.sync.set=false,但已经将FutureContext设置进了InternalThreadLocal,会造成频繁GC的情况
3.1.8版本:
Dubbo协议、Triple协议都没有及时清除FutureContext

Dubbo协议调用

image

Tiple协议调用

Triple未清除原因 同3.0.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugBugs to being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions