Skip to content

No error emitted on ungraceful db server shutdown #1113

Closed
@simopahk

Description

@simopahk

When a database server goes down unnoticed, a single connected client will not emit any errors and continue living up to ~15 minutes until (in a specific case, 'EHOSTUNREACH') socket error is emitted. Setting keepAlive to true in client configuration does not have the desired effect, because the connection object sets _ending to true after sending off the first query (

con.sync();
), which in turn forces 'ECONNRESET' socket events to be ignored (https://github.com/brianc/node-postgres/blob/master/lib/connection.js#L68).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions