Add support TCP user timeout in libpq and the backend server
Michael Paquier <michael@paquier.xyz>
Add support TCP user timeout in libpq and the backend server Similarly to the set of parameters for keepalive, a connection parameter for libpq is added as well as a backend GUC, called tcp_user_timeout. Increasing the TCP user timeout is useful to allow a connection to survive extended periods without end-to-end connection, and decreasing it allows application to fail faster. By default, the parameter is 0, which makes the connection use the system default, and follows a logic close to the keepalive parameters in its handling. When connecting through a Unix-socket domain, the parameters have no effect. Author: Ryohei Nagaura Reviewed-by: Fabien Coelho, Robert Haas, Kyotaro Horiguchi, Kirk Jamison, Mikalai Keida, Takayuki Tsunakawa, Andrei Yahorau Discussion: https://postgr.es/m/EDA4195584F5064680D8130B1CA91C45367328@G01JPEXMBYT04
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/expected/postgres_fdw.out | modified | +1 −0 |
| contrib/postgres_fdw/sql/postgres_fdw.sql | modified | +1 −0 |
| doc/src/sgml/config.sgml | modified | +25 −0 |
| doc/src/sgml/libpq.sgml | modified | +14 −0 |
| src/backend/libpq/pqcomm.c | modified | +73 −0 |
| src/backend/utils/misc/guc.c | modified | +31 −0 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +3 −1 |
| src/include/libpq/libpq-be.h | modified | +5 −1 |
| src/include/utils/guc.h | modified | +1 −0 |
| src/interfaces/libpq/fe-connect.c | modified | +43 −0 |
| src/interfaces/libpq/libpq-int.h | modified | +1 −0 |
Documentation touched
Discussion
- Timeout parameters 120 messages · 2018-10-23 → 2019-04-08