-
Notifications
You must be signed in to change notification settings - Fork 117
Description
I first noticed this when implementing a "release" task in my procfile for a heroku app.
https://devcenter.heroku.com/articles/release-phase#specifying-release-phase-tasks
According to that document, the Procfile spec should be ok with having a short-lived process run alongside a long-lived one. I've not used any other implementation of foreman, and I'm not sure which one is being used on heroku.
I can see here that a killall signal is being emitted whenever a child process exits. It seems intentional, but I'm trying to understand why that would be the desired behavior.
https://github.com/strongloop/node-foreman/blob/master/lib/proc.js#L50-L54
My test case is as follows:
In Procfile
:
release: node release.js
server: node server.js
In release.js
:
console.log("running release task");
In server.js
:
const net = require("net");
const server = net.createServer(() => {});
server.listen(0, () => console.log("server listening"));
process.on("SIGINT", () => process.exit());
And see that all processes are killed when running nf start
. If the release
process is removed, you'll notice that the server is not killed.