Skip to content

TCP keepalives - possible discrepancy with libpq/pg-native #909

@motiz88

Description

@motiz88

I'm just beginning to investigate this issue, on a hunch that it is the cause of a problem I'm having in a pg-then-based app (if the network fails during a query, it hangs).

First, I don't see that node-postgres supports the keepalives connection option in any way. Though I don't know if that's intended.

Second, libpq (and therefore pg-native?) enables TCP keepalives by default, and thus should be able to detect a dropped connection; whereas AFAICT Node's net.Socket (and therefore pg) does not. So, with the same connection string that doesn't explicitly set keepalives, different behaviors would be observed with pg vs. pg-native.

Anyone care to comment/verify/enlighten? :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions