From: | Jelte Fennema-Nio <postgres(at)jeltef(dot)nl> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | Denis Laxalde <denis(dot)laxalde(at)dalibo(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Gregory Stark (as CFM)" <stark(dot)cfm(at)gmail(dot)com>, Jelte Fennema <Jelte(dot)Fennema(at)microsoft(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(at)eisentraut(dot)org>, 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: | 2024-03-06 18:41:10 |
Message-ID: | CAGECzQS0cyWnd86ZJw507zgNmUdhaGdzo0BwOHTJYpUee0qk-A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 6 Mar 2024 at 19:22, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> Docs: one bogus "that that".
will fix
> Did we consider having PQcancelConn() instead be called
> PQcancelCreate()?
Fine by me
> Also, the comment still says
> "Asynchronously cancel a query on the given connection. This requires
> polling the returned PGcancelConn to actually complete the cancellation
> of the query." but this is no longer a good description of what this
> function does.
will fix
> Why do we return a non-NULL pointer from PQcancelConn in the first three
> cases where we return errors? (original conn was NULL, original conn is
> PGINVALID_SOCKET, pqCopyPGconn returns failure) Wouldn't it make more
> sense to free the allocated object and return NULL? Actually, I wonder
> if there's any reason at all to return a valid pointer in any failure
> cases; I mean, do we really expect that application authors are going to
> read/report the error message from a PGcancelConn that failed to be fully
> created?
I think having a useful error message when possible is quite nice. And
I do think people will read/report this error message. Especially
since many people will simply pass it to PQcancelBlocking, whether
it's NULL or not. And then check the status, and then report the error
if the status was CONNECTION_BAD.
> but in any case we
> should set ->cancelRequest in all cases, not only after the first tests
> for errors.
makes sense
> I think the extra PGconn inside pg_cancel_conn is useless; it would be
> simpler to typedef PGcancelConn to PGconn in fe-cancel.c, and remove the
> indirection through the extra struct.
That sounds nice indeed. I'll try it out.
> We could move the definition of struct pg_cancel to fe-cancel.c. Nobody
> outside that needs to know that definition anyway.
will do
From | Date | Subject | |
---|---|---|---|
Next Message | Stephen Frost | 2024-03-06 19:09:59 | Re: Proposal to add page headers to SLRU pages |
Previous Message | Stephen Frost | 2024-03-06 18:28:20 | Re: Statistics Import and Export |