Repository navigation
Commit 39d7a1a
authored
Fix Cilium node-list races, closed-node reuse and the gRPC alarm hook NPE (#14195)
Cilium fetcher (CiliumNodeManager):
- The Peer notify stream, the cluster watcher and the 10-second refresh
timer rebuilt the shared node list without a lock. allNodes was sorted
in place while the Peer thread added or removed nodes, and two rebuilds
diffing the same old usingNodes could open two flow streams for one
node, or publish a node another rebuild had just closed. One nodeLock
now covers node-list changes, the rebuild, listener notification and
close, and start() publishes the first membership snapshot under it
before registering the watcher.
- A node closed when this OAP's share moved away stayed in allNodes as
the same closed instance. When the share moved back (e.g. after scaling
the OAP cluster out and back in), the listener got a null stub, so the
OAP it moved back to could not read that node while the assignment
lasted. A closed node is now replaced in allNodes by a fresh instance.
- The ZooKeeper, Consul, Nacos and etcd coordinators list only registered
OAPs, and only Mixed and Aggregator register, so a Receiver-role OAP
never finds itself in the list. Once Cilium nodes and other OAPs were
listed, findFirst().get() threw on every refresh. It now skips Cilium
fetching with a debug log; the listed OAPs share every node.
gRPC alarm hook (GRPCCallback):
- An alarm or recovery processed while no gRPC hook was configured set
the settings and stub maps to null, while the client map kept its
shut-down clients. Adding a gRPC hook afterwards made every callback
throw a NullPointerException at alarmSettingMap.get() until restart.
The client and stub maps now stay non-null and are cleared instead.
- The client of a hook removed from the configuration is now shut down
instead of leaked. For an existing hook, the client is reused while its
host and port are unchanged; a replacement is built before the old
client is shut down, and null or missing settings are skipped on
rebuild and send.1 parent a6e853b commit 39d7a1a
5 files changed
Lines changed: 621 additions & 85 deletions
File tree
- docs/en/changes
- oap-server
- server-alarm-plugin/src
- main/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc
- test/java/org/apache/skywalking/oap/server/core/alarm/provider/grpc
- server-fetcher-plugin/cilium-fetcher-plugin/src
- main/java/org/apache/skywalking/oap/server/fetcher/cilium/nodes
- test/java/org/apache/skywalking/oap/server/fetcher/cilium/nodes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 58 | + | |
72 | 59 | | |
73 | 60 | | |
74 | 61 | | |
| |||
92 | 79 | | |
93 | 80 | | |
94 | 81 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
101 | 91 | | |
102 | 92 | | |
103 | 93 | | |
| |||
254 | 244 | | |
255 | 245 | | |
256 | 246 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
266 | 255 | | |
267 | 256 | | |
268 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
269 | 265 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
285 | 281 | | |
286 | 282 | | |
287 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
288 | 298 | | |
289 | 299 | | |
0 commit comments