• Robert Haas's avatar
    Add TCP keepalive support to libpq. · d8cd283a
    Robert Haas authored
    This adds four additional connection parameters to libpq: keepalives,
    keepalives_idle, keepalives_count, and keepalives_interval.
    keepalives default to on, per discussion, but can be turned off by
    specifying keepalives=0.  The remaining parameters, where supported,
    can be used to adjust how often keepalives are sent and how many
    can be lost before the connection is broken.
    
    The immediate motivation for this patch is to make sure that
    walreceiver will eventually notice if the master reboots without
    closing the connection cleanly, but it should be helpful in other
    cases as well.
    
    Tollef Fog Heen, Fujii Masao, and me.
    d8cd283a
fe-connect.c 113 KB