from: prisma/prisma#2917
The reason Prisma is cleaning up its child processes, is we'll end up with a dangling child process. So unfortunately Node.js does not make sure, that the child process is killed properly. That's why Prisma Client is cleaning this up, for now, to not introduce a foot gun for Prisma users.
index.js
const { spawn } = require('child_process')
const path = require('path')
const child = spawn('node', [path.join(__dirname, 'run.js')], {
stdio: 'inherit',
})
setTimeout(() => {
process.exit()
}, 100)
run.js
console.log('hao', process.pid)
setTimeout(() => {
console.log('hi')
}, 100000000)