Skip to content

Commit 6d262cc

Browse files
authored
Fix ServerStatusService.statusWatchers concurrent modification. (#12884)
1 parent e0d6411 commit 6d262cc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* BanyanDB: Speed up OAP booting while initializing BanyanDB.
3737
* BanyanDB: Support `@EnableSort` on the column to enable sorting for `IndexRule` and set the default to false.
3838
* Support `Get Effective TTL Configurations` API.
39+
* Fix `ServerStatusService.statusWatchers` concurrent modification.
3940

4041
#### UI
4142

oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/status/ServerStatusService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
package org.apache.skywalking.oap.server.core.status;
2020

21-
import java.util.ArrayList;
2221
import java.util.List;
22+
import java.util.concurrent.CopyOnWriteArrayList;
2323
import lombok.Getter;
2424
import lombok.RequiredArgsConstructor;
2525
import org.apache.skywalking.oap.server.core.CoreModuleConfig;
@@ -46,7 +46,7 @@ public class ServerStatusService implements Service {
4646
@Getter
4747
private ClusterStatus clusterStatus = new ClusterStatus();
4848

49-
private List<ServerStatusWatcher> statusWatchers = new ArrayList<>();
49+
private List<ServerStatusWatcher> statusWatchers = new CopyOnWriteArrayList<>();
5050

5151
private List<ApplicationConfiguration.ModuleConfiguration> configurations;
5252

0 commit comments

Comments
 (0)