Commit 9e7fb63
authored
fix(ext/node): implement timeout and killSignal for spawn() (#32283)
Fixes the `timeout` and `killSignal` options for `child_process.spawn()`
(and `fork()`, which delegates to `spawn()`). Previously these options
were accepted but silently ignored.
The fix sets a `setTimeout` after spawning that kills the child with the
specified `killSignal` (default: `"SIGTERM"`) if the process hasn't
exited within `timeout` ms. The timer is cleared if the process exits
naturally before the deadline.1 parent 38f3ffe commit 9e7fb63
File tree
3 files changed
+20
-6
lines changed- ext/node/polyfills
- internal
- tests/node_compat
3 files changed
+20
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
228 | 246 | | |
229 | 247 | | |
230 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | 1474 | | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | 1475 | | |
1482 | 1476 | | |
1483 | 1477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| |||
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| 205 | + | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
| |||
0 commit comments