-
Notifications
You must be signed in to change notification settings - Fork 93
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
SIGINT handlers defined in app are not executed #192
SIGINT handlers defined in app are not executed #192
Comments
@alexandervain Very good find. This always went unnoticed in the tests as we do not have any custom SIGINT handlers installed. I wonder why the routine even checks the doExit parameter... |
Ok, the doExit was there for a reason, having to do with jest and how it is managing its sandboxes, which eventually will run the initialising code of tmp multiple times. I think I have nailed it down and will prepare a PR now. |
@alexandervain @papandreou Does this commit fix the bug? df8df51 |
Summary: The SIGINT handler in headless was being squashed by the one that `tmp` adds. This is a bug introduced in its latest release: raszi/node-tmp#192 Downgrading version to fix this for now. There's a PR to fix it, we can upgrade when it's shipped. Reviewed By: passy Differential Revision: D16163208 fbshipit-source-id: 058ec1094dd2e5e5474f7ac36be376bae0431f0c
There is also the case of async handlers - we have process.on() handlers that return promise, and NodeJS will wait for those promises to resolve before existing. As I understand df8df51, it will call original handlers in a sync matter, which will not give async functions enough time to complete. |
sounds good - how about merging #193 ? |
fix #192: tmp must not exit the process on its own
Operating System
NodeJS Version
Tmp Version
Expected Behavior
Allow executing app defined SIGINT handlers
Experienced Behavior
App exits before custom handlers are executed.
Here is the reason: /~https://github.com/raszi/node-tmp/blob/master/lib/tmp.js#L635
Code to reproduce:
Custom SIGINT handler - do some clean up not printed.
The same code works OK with
tmp@0.0.33
The text was updated successfully, but these errors were encountered: