File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
apollo-client/src/main/java/com/ctrip/framework/apollo/spring/property Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Apollo Java 2.4.0
1212* [ Feature Support Kubernetes ConfigMap cache for Apollo java, golang client] ( https://github.com/apolloconfig/apollo-java/pull/79 )
1313* [ Feature support pulling configuration information from multiple AppIds] ( https://github.com/apolloconfig/apollo-java/pull/70 )
1414* [ Fix monitor arg cause npe] ( https://github.com/apolloconfig/apollo-java/pull/86 )
15+ * [ Fix the concurrent issue in SpringValueRegistry.scanAndClean] ( https://github.com/apolloconfig/apollo-java/pull/95 )
1516
1617------------------
1718All issues and pull requests are [ here] ( https://github.com/apolloconfig/apollo-java/milestone/4?closed=1 )
Original file line number Diff line number Diff line change @@ -84,12 +84,15 @@ private void scanAndClean() {
8484 Iterator <Multimap <String , SpringValue >> iterator = registry .values ().iterator ();
8585 while (!Thread .currentThread ().isInterrupted () && iterator .hasNext ()) {
8686 Multimap <String , SpringValue > springValues = iterator .next ();
87- Iterator <Entry <String , SpringValue >> springValueIterator = springValues .entries ().iterator ();
88- while (springValueIterator .hasNext ()) {
89- Entry <String , SpringValue > springValue = springValueIterator .next ();
90- if (!springValue .getValue ().isTargetBeanValid ()) {
91- // clear unused spring values
92- springValueIterator .remove ();
87+ synchronized (springValues ) {
88+ Iterator <Entry <String , SpringValue >> springValueIterator = springValues .entries ()
89+ .iterator ();
90+ while (springValueIterator .hasNext ()) {
91+ Entry <String , SpringValue > springValue = springValueIterator .next ();
92+ if (!springValue .getValue ().isTargetBeanValid ()) {
93+ // clear unused spring values
94+ springValueIterator .remove ();
95+ }
9396 }
9497 }
9598 }
You can’t perform that action at this time.
0 commit comments