Unverified Commit 2aee3ef0 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Ensure child processes can clean up (#53439)

## What?

Since the recent changes to the server the CPU profile for the router process was no longer written on `ctrl + c`. Turns out the reason is that we now call kill with `SIGKILL` which can't be observed in Node.js.

I've changed it to `SIGINT` instead so that the SIGINT handlers are called during cleanup. The CPU profile writing happens in SIGINT.
parent 10f74a1d
...@@ -252,7 +252,7 @@ export async function initialize(opts: { ...@@ -252,7 +252,7 @@ export async function initialize(opts: {
] as { ] as {
_child?: import('child_process').ChildProcess _child?: import('child_process').ChildProcess
}[]) { }[]) {
curWorker._child?.kill('SIGKILL') curWorker._child?.kill('SIGINT')
} }
} }
process.on('exit', cleanup) process.on('exit', cleanup)
......
...@@ -266,7 +266,7 @@ export async function startServer({ ...@@ -266,7 +266,7 @@ export async function startServer({
[]) as { []) as {
_child?: ChildProcess _child?: ChildProcess
}[]) { }[]) {
curWorker._child?.kill('SIGKILL') curWorker._child?.kill('SIGINT')
} }
} }
process.on('exit', cleanup) process.on('exit', cleanup)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment