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

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Issue in postgres_fdw causing unnecessary wait for cancel request reply
Date: 2023-04-14 09:59:06
Message-ID: CAPmGK15YigmZKzVBGYPdmo-QMHBdhNupK8L6kUBdUtMERkbXsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 14, 2023 at 3:19 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> On 2023/04/13 15:13, Etsuro Fujita wrote:
> > 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
>
> The primary message basically should avoid reference to implementation details such as specific structure names like PGcancel, shouldn't it, as per the error message style guide?

I do not think that PGcancel is that specific, as it is described in
the user-facing documentation [1]. (In addition, the error message I
proposed was created by copying the existing error message "could not
create OpenSSL BIO structure" in contrib/sslinfo.c.)

> > former case, so we can distinguish the former error from the latter?
>
> Although the primary message is the same, the supplemental message provides additional context that can help distinguish which function is reporting the message.

If the user is familiar with the PQgetCancel/PQcancel internals, this
is true, but if not, I do not think this is always true. Consider
this error message, for example:

2023-04-14 17:48:55.862 JST [24344] WARNING: could not send cancel
request: invalid integer value "99999999999" for connection option
"keepalives"

It would be hard for users without the knowledge about those internals
to distinguish that from this message. For average users, I think it
would be good to use a more distinguishable error message.

Best regards,
Etsuro Fujita

[1] https://www.postgresql.org/docs/current/libpq-cancel.html

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2023-04-14 10:03:03 Re: Adding argument names to aggregate functions
Previous Message Dagfinn Ilmari Mannsåker 2023-04-14 09:29:49 Re: Tab completion for AT TIME ZONE