Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graceful shutdown using child processes #519

Closed
endel opened this issue Jan 20, 2018 · 3 comments
Closed

graceful shutdown using child processes #519

endel opened this issue Jan 20, 2018 · 3 comments

Comments

@endel
Copy link

endel commented Jan 20, 2018

Whilst issue #457 has been fixed on ts-node@4.1.x, the behaviour is still wrong when using child processes. (cluster module)

I've updated my sample project to demonstrate the issue here: https://github.com/endel/ts-node-graceful-shutdown-issue

ts-node behaviour:

SIGINT can be catched only for the master process.

$ ./node_modules/.bin/ts-node index.ts
^CShutting down MASTER...
MASTER has been shut down.

node behaviour:

SIGINT can be catched for master and child process.

$ node index.js
^CShutting down CHILD...
Shutting down MASTER...
CHILD has been shut down.
MASTER has been shut down.

Related pull request: #419

@jwhitmarsh
Copy link

I was just about to open an issue, but I think this is related - i'm getting issues when running with the --inspect flag. Stopping and starting a process throws Starting inspector on 127.0.0.1:9229 failed: address already in use - presumably because the inspector is a child process which hasn't been stopped?

@jwhitmarsh
Copy link

After a bit more digging around in the issues it seems as though node --inspect -r ts-node/register works, which is perhaps expected?

@blakeembrey
Copy link
Member

Closing with #536. Pushing people toward node -r ts-node/register for advanced usage since there's been a bunch of drawbacks with both approaches I've taken for supporting node.js flags natively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants