exceljs / exceljs

Excel Workbook Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Process doesn't exit < 8.12.0

opened this issue · comments

I had issue closing my app with cmd+x (SIGINT).
The process doesn't close.

Could you please add a note in changelog. The problem appeares in version 1.9.1, because temp package got upgraded.

https://www.npmjs.com/package/tmp

Node Version: < 8.12.0
Package Version: > 1.9.0

Thanks a lot

I also ran into this and brought it up here: 6f589b2#commitcomment-33747017

The workaround is to downgrade to exceljs 1.10.0 until raszi/node-tmp#193 gets landed 🤷‍♂

Ping @alubbe, given that the latest exceljs is affected, and that it seems to take a while to get that tmp issue fixed -- do you think there's anything we can do here? Do you think the cure is worse than the disease?

Let's ask them - ideally, they merge the PR and we have the best of both worlds

This issue still persists. Using the module prevents using sigint signals. This prevents any sort of graceful shutdown procedures when using this module. Further, the node tmp module seems partially ambandoned as maintainers apparently have no permissions to push new versions to npm and there is a major security issue as well: raszi/node-tmp#205

Is there any chance to switch to a different lib for creating tmp directories?

sub dependencies shouldn't be messing around with high level process lifecycle stuff.

Another workaround for those who want to avoid downgrading exceljs, is to remove the listener created by tmp:

let _tmp$sigint_listener;
const sigintListeners = process.listeners('SIGINT');
for (let listener of sigintListeners) {
    if (listener.name === '_tmp$sigint_listener') { // this is the unique name of the listener function
        _tmp$sigint_listener = listener; // extract and save for later
        process.removeListener('SIGINT', listener);
        break;
    }
}

Then in your application's shutdown routine, you can call _tmp$sigint_listener whenever you like and are ready to exit.

v0.2.0 of tmp has been released which removes its SIGINT handler.

https://github.com/raszi/node-tmp/blob/HEAD/CHANGELOG.md

Should exceljs upgrade to this?

Absolutely! #1234