gpdb
gpdb copied to clipboard
Add support TCP user timeout in libpq and the backend server
This is a draft of a backport of 249d64999 Postgres commit with tcp_user_timeout.
If I may ask, what issue/limitation did you encounter to need this feature backported?
AFAIR there are infinite timeouts in libpq which led to some incidents in the production of our services. That's why our setup guide contains recommendations to adjust keepalives and TCP user timeout. When we are receiving a message libpq relies on OS detecting TCP failure. But OS can wait for a very long time unless tcp user timeout is configured.
Maybe @efimkin could add some info on why do we want this setting.
I'll fix the PR after vacation, thanks for the review @jimmyyih !
@x4m please address the comments posted by Jimmy and resolve the conflicts reported for the PR, then we can go ahead to commit the same.