Subject: Re: Issue in postgres_fdw causing unnecessary wait for cancel request reply

From: Etsuro Fujita <[email-masked]>
Date: Thu, 13 Apr 2023 15:13:31 +0900

Hi Fujii-san,

On Wed, Apr 12, 2023 at 3:36 AM Fujii Masao <[email-masked]> wrote:
> However, if PQgetCancel() returned NULL and no cancel request was issued,
> I found that postgres_fdw could still wait for the reply to
> the cancel request, causing unnecessary wait time with a 30 second timeout.

Good catch!

> Attached patch fixes this issue.

I am not 100% sure that it is a good idea to use the same error
message "could not send cancel request" for the PQgetCancel() and
PQcancel() cases, because they are different functions.  How about
"could not create PGcancel structure” or something like that, for the
former case, so we can distinguish the former error from the latter?

Best regards,
Etsuro Fujita