Commit 9016b9c
fix: worker crash resilience — auto-restart, embed timeout, proxy retry on timeout
If the embed worker thread crashes (OOM, unhandled rejection, etc.), the server
becomes a zombie: /ping responds but /search hangs forever because embed() returns
a promise that never resolves.
Three fixes:
1. Worker auto-restarts on crash (exit handler with 2s backoff)
2. embed() has 60s timeout — rejects instead of hanging forever
3. Proxy callServerWithRetry now catches timeout errors (not just ECONNREFUSED)
so a zombie server triggers relaunch instead of surfacing a timeout to the user.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a443a79 commit 9016b9c
File tree
4 files changed
+52
-13
lines changed4 files changed
+52
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
40 | 52 | | |
41 | 53 | | |
42 | | - | |
43 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
44 | 57 | | |
45 | | - | |
| 58 | + | |
46 | 59 | | |
47 | 60 | | |
| 61 | + | |
48 | 62 | | |
49 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
50 | 75 | | |
51 | 76 | | |
52 | 77 | | |
53 | 78 | | |
54 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
55 | 83 | | |
56 | | - | |
57 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
58 | 96 | | |
59 | 97 | | |
60 | 98 | | |
| |||
0 commit comments