Skip to content

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

@mhdawson

Description

@mhdawson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions