nacos icon indicating copy to clipboard operation
nacos copied to clipboard

nacos-custom-environment-plugin vaule null,ConcurrentModificationException

Open jieas1362 opened this issue 8 months ago • 5 comments

Describe the bug nacos-custom-environment-plugin location:com.alibaba.nacos.plugin.environment.CustomEnvironmentPluginManager#getCustomValues Image

An exception occurs when the value is null

Image

Expected behavior It can be removed normally when the value is null

Actually behavior exception

Desktop (please complete the following information):

  • Version nacos-server 2.4.3 , nacos-client 2.4.3

jieas1362 avatar May 13 '25 02:05 jieas1362

I start up with 2.4.3, can't reproduce this problem. Can you provide more information such as what's the step of reproduce.

KomachiSion avatar May 14 '25 01:05 KomachiSion

i use jdk: 1.8 Can be reproduced,Try to write the plugin code like this

Image The Value of the Map needs to have a null value

jieas1362 avatar May 14 '25 02:05 jieas1362

Why you put null value in your plugin?

KomachiSion avatar May 19 '25 07:05 KomachiSion

Why you put null value in your plugin?

I want to delete this property,i know can use "" but I used null for the first time

jieas1362 avatar May 19 '25 09:05 jieas1362

I see. It is not the null problem ,but the operation in for loop.

Welcome submit PR to fix this problem by first loop found the null value keys and then removeAll keys which null value.

KomachiSion avatar May 26 '25 06:05 KomachiSion

plz assign to me

capthua avatar Jul 10 '25 07:07 capthua

@KomachiSion 我把这个 bug 修复了~

FangYuan33 avatar Jul 18 '25 03:07 FangYuan33

@KomachiSion 我把这个 bug 修复了~

which PR? Please link PR and issue

KomachiSion avatar Jul 21 '25 02:07 KomachiSion