PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings
От
Jelte Fennema
Тема
PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings
Дата
Msg-id
AM5PR83MB017870DE81FC84D5E21E9D1EF7AA9@AM5PR83MB0178.EURPRD83.prod.outlook.com
Список
Дерево обсуждения
PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Zhihong Yu <zyu@yugabyte.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Fujii Masao <masao.fujii@oss.nttdata.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Andres Freund <andres@anarazel.de>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Jelte Fennema <Jelte.Fennema@microsoft.com>
Re: [EXTERNAL] Re: PQcancel does not use tcp_user_timeout, connect_timeout and keepalive settings Tom Lane <tgl@sss.pgh.pa.us>
The new connection made by PQcancel does not use the tcp_user_timeout, connect_timeout or any of the keepalive settings that are provided in the connection string. This means that a call to PQcancel can block for a much longer time than intended if there are network issues. This can be especially impactful, because PQcancel is a blocking function an there is no non blocking version of it. I attached a proposed patch to use the tcp_user_timeout from the connection string when connecting to Postgres in PQcancel. This resolves the issue for me, since this will make connecting timeout after a configurable time. So the other options are not strictly needed. It might still be nice for completeness to support them too though. I didn't do this yet, because I first wanted some feedback and also because implementing connect_timeout would require using non blocking TCP to connect and then use select to have a timeout.
В списке pgsql-hackers по дате отправления
От: Zhihong Yu
Дата: