Commit 5073274
authored
Guard maps in legacy handler (#9)
## Overview
While doing some local stress testing I actually hit the case where
concurrent map writes caused us to crash out:
```
[neko] fatal error: concurrent map writes
[neko] goroutine 5642 [running]:
[neko] internal/runtime/maps.fatal({0x13955ef?, 0x0?})
/usr/local/go/src/runtime/panic.go:1046 +0x20
[neko] internal/runtime/maps.(*Map).Delete(0x40001157a0, 0x1260ce0, 0x40021b7438)
/usr/local/go/src/internal/runtime/maps/map.go:652 +0x48
[neko] github.com/m1k1o/neko/server/internal/http/legacy.(*session).destroy(0x40032ea5a0)
/src/internal/http/legacy/session.go:207 +0xd0
[neko] github.com/m1k1o/neko/server/internal/http/legacy.(*LegacyHandler).Route.func1({0xffff4dcc1c60, 0x400213b8c0}, 0x4002860140)
/src/internal/http/legacy/handler.go:212 +0x794
```
Fixing for reliability!
I also had gpt-5 scan the `internal` implementation for any similar
cases, resulting in
c667c74
## Testing
CI1 parent 560fac5 commit 5073274
File tree
3 files changed
+18
-2
lines changed- server/internal
- capture
- http/legacy
3 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
154 | | - | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
167 | | - | |
| 170 | + | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
| |||
408 | 411 | | |
409 | 412 | | |
410 | 413 | | |
| 414 | + | |
| 415 | + | |
411 | 416 | | |
412 | 417 | | |
413 | 418 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
393 | 395 | | |
394 | 396 | | |
395 | 397 | | |
| 398 | + | |
| 399 | + | |
396 | 400 | | |
397 | 401 | | |
398 | 402 | | |
| |||
404 | 408 | | |
405 | 409 | | |
406 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
407 | 414 | | |
408 | 415 | | |
409 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
184 | 186 | | |
185 | 187 | | |
186 | 188 | | |
| |||
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| 209 | + | |
| 210 | + | |
207 | 211 | | |
208 | 212 | | |
0 commit comments