Commit d2db0c2
authored
Fix module commandresult event cleanup during unsubscribe and module unload (valkey-io#3545)
This follows up on the commandresult API work and fixes cleanup around
unsubscribe and module unload.
The main issue was that command-result event listeners could leave stale
state behind. On unload, we removed the listeners themselves but didn’t
fully update the fast-path listener counters. Separately, unsubscribing
with a NULL callback could behave badly if the listener wasn’t present
anymore. In practice, that meant later commands could still walk into
command-result event handling after the module was supposed to be
cleaned up.
Failed in Daily as well yesterday:
https://github.com/valkey-io/valkey/actions/runs/24753491944/job/72421581610#step:10:852
Related Failures:
valkey-io#2936 (comment)
---------
Signed-off-by: Sarthak Aggarwal <sarthagg@amazon.com>1 parent cb2cfdd commit d2db0c2
3 files changed
Lines changed: 39 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12718 | 12718 | | |
12719 | 12719 | | |
12720 | 12720 | | |
| 12721 | + | |
| 12722 | + | |
12721 | 12723 | | |
12722 | 12724 | | |
12723 | 12725 | | |
| |||
12877 | 12879 | | |
12878 | 12880 | | |
12879 | 12881 | | |
12880 | | - | |
12881 | 12882 | | |
| 12883 | + | |
12882 | 12884 | | |
12883 | 12885 | | |
12884 | 12886 | | |
| 12887 | + | |
| 12888 | + | |
| 12889 | + | |
| 12890 | + | |
| 12891 | + | |
| 12892 | + | |
| 12893 | + | |
| 12894 | + | |
12885 | 12895 | | |
12886 | 12896 | | |
12887 | 12897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
| 254 | + | |
246 | 255 | | |
247 | 256 | | |
248 | 257 | | |
249 | 258 | | |
250 | 259 | | |
251 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
252 | 267 | | |
253 | 268 | | |
254 | 269 | | |
255 | 270 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | 271 | | |
271 | 272 | | |
272 | 273 | | |
| |||
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
| 444 | + | |
| 445 | + | |
443 | 446 | | |
444 | 447 | | |
445 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| |||
267 | 265 | | |
268 | 266 | | |
269 | 267 | | |
270 | | - | |
| 268 | + | |
271 | 269 | | |
272 | 270 | | |
273 | | - | |
| 271 | + | |
| 272 | + | |
274 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
627 | 629 | | |
628 | 630 | | |
629 | 631 | | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
630 | 635 | | |
631 | 636 | | |
632 | 637 | | |
| |||
0 commit comments