Commit 52cfcb3
fix(liveness): skip self.close() on SIGTERM during HMR/watch dev mode
Deno's HMR and --watch modes use a parent/child process model where the
parent sends SIGTERM to signal the child to restart. The liveness
middleware's SIGTERM handler was calling self.close(), which kills the
process before Deno can complete its restart cycle — causing every dev
server to die on the first file change instead of hot-reloading.
Only call self.close() in production (k8s) where SIGTERM means the pod
must shut down. In dev mode (--unstable-hmr or --watch), let the
process terminate naturally so Deno can relaunch it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent ce2cbd7 commit 52cfcb3
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
72 | 79 | | |
73 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| |||
0 commit comments