Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore - Mailing list pgsql-hackers

From Jelte Fennema-Nio
Subject Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Date
Msg-id DJS6DTW9NJUB.FKBYKWOWB0WG@jeltef.nl
Whole thread
In response to Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
Re: Don't use the deprecated and insecure PQcancel in our frontend tools anymore
List pgsql-hackers
On Tue Jul 7, 2026 at 12:12 AM CEST, Heikki Linnakangas wrote:
> This relies on the signal to interrupt select(), but I'm afraid that's
> not guaranteed on all platforms. Also, there's a race condition if the
> signal arrives *just* before you call select(). That's what the
> "self-pipe hack" is for, see comments at waiteventset.c.

Ugh yes you're right. The comment above that block told me otherwise and
I didn't question it. Attached is a new version that improves the
comment and starts using the same 1 second poll on all platforms.

Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
Next
From: "Jelte Fennema-Nio"
Date:
Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup