seata ClientOnResponseProcessor#mergeMsgMap&futures is a risk of memory leaks

uajslkp6  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(108)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

timeout发生如tc网络出现故障或宕机,消息实际上已达到tc时,但无法将response响应时候没有去清除mergemsgmap和futures里的数据,而是单纯的靠server的response下来再remove(详见ClientOnResponseProcessor#process),这带来一个问题,server非优雅下线的时候,这个futures和mergemsgmap无法清理,残留了数据
AbstractNettyRemotingClient#MergedSendRunnable 中也仅对发送失败时清理了futures(该内存泄露问题的前提是client发送成功,tc响应失败),mergemsgmap并没有清理

ps:该情况出现概率非常非常低,通过阅读这块代码逻辑偶然发现

Ⅱ. Describe what happened

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

Just paste your stack trace here!

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

Ⅵ. Environment:

  • JDK version :
  • Seata version:
  • OS :
  • Others:
ecr0jaav

ecr0jaav1#

@objcoding@slievrly@l81893521 请帮我一起确认这个问题是否实际存在

bzzcjhmw

bzzcjhmw2#

I confirm that it is there.

相关问题