Commit 844d1b9
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 96a1dd6 commit 844d1b9
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 | | |
| |||
2365 | 2370 | | |
2366 | 2371 | | |
2367 | 2372 | | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
2368 | 2387 | | |
2369 | 2388 | | |
2370 | 2389 | | |
| |||
2378 | 2397 | | |
2379 | 2398 | | |
2380 | 2399 | | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
2381 | 2404 | | |
2382 | 2405 | | |
2383 | 2406 | | |
| |||
| 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