Skip to content

all processes are killed if one process exits #167

@jmcantrell

Description

@jmcantrell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions