Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jelte Fennema <Jelte.Fennema@microsoft.com>
Cc: Andres Freund <andres@anarazel.de>, Fujii Masao <masao.fujii@oss.nttdata.com>, Zhihong Yu <zyu@yugabyte.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-01-18T18:32:55Z
Lists: pgsql-hackers
Jelte Fennema <Jelte.Fennema@microsoft.com> writes:
> It seems the man page of TCP_USER_TIMEOUT does not align with 
> reality then. When I use it on my local machine it is effectively used
> as a connection timeout too.

Huh, I should have thought to try that.  I confirm this behavior
on RHEL8 (kernel 4.18.0).  Not the first mistake I've seen in
Linux man pages :-(.

Doesn't seem to help on macOS, but AFAICT that platform doesn't
have TCP_USER_TIMEOUT, so no surprise there.

Anyway, that removes my objection, so I'll proceed with committing.
Thanks for working on this patch!

			regards, tom lane



Commits

  1. Make PQcancel use the PGconn's tcp_user_timeout and keepalives settings.

  2. Avoid calling gettext() in signal handlers.

  3. Avoid calling strerror[_r] in PQcancel().