Commit b99a8a2
committed
src: replace duplicate loop hook regs
Replace blocked and unblocked loop hook entries when the same callback
is registered again.
These hooks were stored in append-only TSList containers, so dynamic
reconfiguration in agents like gRPC and ZMQ kept stale registrations
alive. That caused duplicate callback delivery and let old blocked loop
thresholds continue affecting detection.
Add TSList::replace_if() and use it in blocked and unblocked loop
hook registration. When the callback function pointer matches an
existing entry, overwrite it instead of appending a new one.
For blocked loop hooks, recompute min_blocked_threshold_ after each
registration so a replaced threshold immediately becomes effective.1 parent d41bff4 commit b99a8a2
File tree
4 files changed
+124
-8
lines changed- src/nsolid
- test/agents
4 files changed
+124
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
967 | 968 | | |
968 | 969 | | |
969 | 970 | | |
970 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
971 | 975 | | |
972 | | - | |
973 | | - | |
| 976 | + | |
974 | 977 | | |
975 | 978 | | |
976 | 979 | | |
| |||
979 | 982 | | |
980 | 983 | | |
981 | 984 | | |
982 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
983 | 989 | | |
984 | 990 | | |
985 | 991 | | |
| |||
1010 | 1016 | | |
1011 | 1017 | | |
1012 | 1018 | | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1013 | 1030 | | |
1014 | 1031 | | |
1015 | 1032 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| 636 | + | |
636 | 637 | | |
637 | 638 | | |
638 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
147 | 183 | | |
148 | 184 | | |
149 | 185 | | |
| |||
163 | 199 | | |
164 | 200 | | |
165 | 201 | | |
166 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
167 | 206 | | |
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
171 | 251 | | |
172 | 252 | | |
173 | 253 | | |
174 | 254 | | |
175 | 255 | | |
176 | 256 | | |
177 | | - | |
| 257 | + | |
178 | 258 | | |
179 | 259 | | |
180 | 260 | | |
| |||
194 | 274 | | |
195 | 275 | | |
196 | 276 | | |
197 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
198 | 281 | | |
199 | 282 | | |
200 | 283 | | |
201 | 284 | | |
202 | 285 | | |
203 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
204 | 290 | | |
205 | 291 | | |
206 | 292 | | |
| |||
0 commit comments