Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

From: Jelte Fennema <me(at)jeltef(dot)nl>
To: Jelte Fennema <Jelte(dot)Fennema(at)microsoft(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Jacob Champion <jchampion(at)timescale(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel
Date: 2023-01-26 16:42:37
Message-ID: CAGECzQT_VgOWWENUqvUV9xQmbaCyXjtRRAYO8W07oqashk_N+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

After discussing this patch privately with Andres I created a new
version of this patch.
The main changes are:
1. Build on top of a refactor to addrinfo handling I had done for
another patch of mine (libpq load balancing). This allows creation of
a fake addrinfo list, which made it possible to remove lots of special
cases for cancel requests from PQconnectPoll
2. Move -2 return value of pqReadData to a separate commit.
3. Move usage of new cancel APIs to a separate commit.
4. Move most of the logic that's specific to cancel requests to cancel
related functions, e.g. PQcancelPoll does more than simply forwarding
to PQconnectPoll now.
5. Copy over the connhost data from the original connection, instead
of assuming that it will be rebuilt identically in the cancel
connection. The main reason for this is that when/if the loadbalancing
patch gets merged, then it won't necessarily be rebuilt identically
anymore.

Attachment Content-Type Size
v10-0001-libpq-Run-pgindent-after-a9e9a9f32b3.patch application/octet-stream 39.4 KB
v10-0002-Refactor-libpq-to-store-addrinfo-in-a-libpq-owne.patch application/octet-stream 11.5 KB
v10-0004-Add-non-blocking-version-of-PQcancel.patch application/octet-stream 45.0 KB
v10-0003-Return-2-from-pqReadData-on-EOF.patch application/octet-stream 4.3 KB
v10-0005-Start-using-new-libpq-cancel-APIs.patch application/octet-stream 9.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-01-26 16:54:11 Re: run pgindent on a regular basis / scripted manner
Previous Message Andres Freund 2023-01-26 16:35:45 Re: New strategies for freezing, advancing relfrozenxid early