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

Crash if db.close() is called in process.on('exit') #1455

Open
mhdawson opened this issue Mar 20, 2021 · 0 comments
Open

Crash if db.close() is called in process.on('exit') #1455

mhdawson opened this issue Mar 20, 2021 · 0 comments
Labels

Comments

@mhdawson
Copy link

This code was in a sample application that was looking at

    process.on('exit', (code) => {
        db.close((err) => {
            logger.error('Error closing DB: ' + err.message);
        });

And it resulted in a consistent crash with the stack trace as shown in the comment on this issue: nodejs/node-addon-api#902 (comment)

My question is whether closeing the db in the exit handler is expected to work or if this is a case of user error

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

No branches or pull requests

2 participants