Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings
Jelte Fennema-Nio <jelte.fennema@microsoft.com>
From: Jelte Fennema <Jelte.Fennema@microsoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Zhihong Yu <zyu@yugabyte.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-12-28T15:49:00Z
Lists: pgsql-hackers
Attachments
- 0001-Use-timeout-socket-options-for-cancel-connections.patch (application/octet-stream) patch 0001
- 0002-Honor-connect_timeout-when-connecting-with-PQcancel.patch (application/octet-stream) patch 0002
I was able to spend some time on this again. I attached two patches to this email: The first patch is a cleaned up version of my previous patch. I think I addressed all feedback on the previous version in that patch (e.g. removed windows code, fixed formatting). The second patch is a new one, it implements honouring of the connect_timeout connection option in PQcancel. This patch requires the first patch to also be applied, but since it seemed fairly separate and the code is not trivial I didn't want the first patch to be blocked on this. Finally, I would love it if once these fixes are merged the would also be backpatched to previous versions of libpq. Does that seem possible? As far as I can tell it would be fine, since it doesn't really change any of the public APIs. The only change is that the pg_cancel struct now has a few additional fields. But since that struct is defined in libpq-int.h, so that struct should not be used by users of libpq directly, right?.
Commits
-
Make PQcancel use the PGconn's tcp_user_timeout and keepalives settings.
- 5987feb70b5b 15.0 landed
-
Avoid calling gettext() in signal handlers.
- d18ec312f9f3 13.6 landed
- 92e6c1c9be15 11.15 landed
- 6d1a854c157e 12.10 landed
- 62bfa554b285 10.20 landed
- 4e8726566e4d 14.2 landed
- 2131c049d338 15.0 landed
-
Avoid calling strerror[_r] in PQcancel().
- 9d66c43eb4c8 10.20 landed
- f3f467b8f69b 15.0 landed
- f27af7b880de 13.6 landed
- 8b107467c632 11.15 landed
- 38f099ef935b 12.10 landed
- 050949877004 14.2 landed