public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: Re: pgsql: Make cancel request keys longer
Date: Tue, 8 Apr 2025 22:41:31 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>

On 08/04/2025 20:06, Peter Eisentraut wrote:
> On 02.04.25 15:43, Heikki Linnakangas wrote:
>> Make cancel request keys longer
> 
> This patch changed the signature of ProcSignal()
> 
> -ProcSignalInit(bool cancel_key_valid, int32 cancel_key)
> +ProcSignalInit(char *cancel_key, int cancel_key_len)
> 
> but did not update the caller in auxprocess.c:
> 
> ProcSignalInit(false, 0);
> 
> This gives a warning with clang.

Good catch. I wonder why the cirrus CI didn't complain, it has a step to 
check for warnings with clang.

> While I was looking at this, I suggest to make the first argument void 
> *.  This is consistent for passing binary data.

Ok, sure.

> Also, I wonder why MyCancelKeyLength is of type uint8 rather than 
> something more mundane like int.  There doesn't seem to be any API 
> reason for this type.

Agreed. The cancel key length is documented to be at most 256 bytes, but 
that's more of a coincidence, nothing depends on that variable being uint8.

> See attached patch for possible changes.

Looks good to me. I can commit these tomorrow, or feel free to do it 
yourself too.

Thank you!

-- 
Heikki Linnakangas
Neon (https://neon.tech)





view thread (11+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pgsql: Make cancel request keys longer
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox