Commit 458aef3
[release/8.0] SignalR performance: track groups per connection, remove on disconnect (#53862)
* SignalR: track groups per connection, remove on disconnect, fixes #48249 Instead of iterating over ALL the groups, which is slow and even introduces a DDoS vector, we remove from groups that are specific to this connection
* Removed unused method
* Apply suggestions from code review
Co-authored-by: Brennan <[email protected]>
* More code review suggestions with a minor fix
* Use lock instead of ToArray (the latter iterates anyway)
* Made the HashSet an internal property on HubConnectionContext
* Removed unneeded "using"
* Removed ignore-case from group tracking
* Addressed race condition from code review
---------
Co-authored-by: alex-jitbit <[email protected]>
Co-authored-by: Brennan <[email protected]>1 parent aad6550 commit 458aef3
File tree
3 files changed
+35
-13
lines changed- src/SignalR/server/Core/src
- Internal
3 files changed
+35
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
46 | 57 | | |
47 | 58 | | |
48 | 59 | | |
| |||
64 | 75 | | |
65 | 76 | | |
66 | 77 | | |
67 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
68 | 89 | | |
69 | 90 | | |
70 | 91 | | |
| |||
277 | 298 | | |
278 | 299 | | |
279 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
280 | 310 | | |
281 | | - | |
282 | 311 | | |
283 | 312 | | |
284 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 45 | | |
56 | 46 | | |
57 | 47 | | |
| |||
0 commit comments