Commit 45fc88c
committed
fix(gateway): health check timeout when lsof is not installed
The `ownsPort` check in `inspectGatewayRestart` only verified port
ownership via `portUsage.listeners.some(...)` when `runtimePid` was
known. When `lsof` is not installed, `inspectPortUsage` returns
`{ status: "busy", listeners: [] }` because `checkPortInUse` detects
the port is occupied but cannot enumerate listeners. `.some()` on an
empty array always returns `false`, so `ownsPort` was always `false`,
causing the health-check loop to spin for the full 60 s timeout on
every restart.
Add the same `(status === "busy" && listeners.length === 0)` fallback
that already existed in the `runtimePid == null` branch so that a
running service with a known PID is treated as the port owner when
listener enumeration is unavailable.1 parent 0b3bbfe commit 45fc88c
2 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
126 | 146 | | |
127 | 147 | | |
128 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
0 commit comments