Commit d016926
committed
fix(viewer): singleton guard prevents port drift on reactivation
When the host gateway restarts and re-calls activate(), the previous
ViewerServer instance may still hold the port. Without cleanup, the new
instance hits EADDRINUSE and drifts to 18800+, causing Memory unavailable.
- Add module-level singleton tracking for ViewerServer
- Stop previous viewer instance before creating new one in activate()
- Ensure server.stop() fully releases the HTTP port
Fixes #14301 parent 45f4c1b commit d016926
2 files changed
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
2324 | 2329 | | |
2325 | 2330 | | |
2326 | 2331 | | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
2327 | 2346 | | |
2328 | 2347 | | |
2329 | 2348 | | |
| |||
2337 | 2356 | | |
2338 | 2357 | | |
2339 | 2358 | | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
2340 | 2363 | | |
2341 | 2364 | | |
2342 | 2365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| |||
0 commit comments