Re: psql not responding to SIGINT upon db reconnection - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: psql not responding to SIGINT upon db reconnection
Date
Msg-id 5e28b89f-0033-4e42-8184-b71b731c1aa2@iki.fi
Whole thread Raw
In response to Re: psql not responding to SIGINT upon db reconnection  ("Tristan Partin" <tristan@neon.tech>)
Responses Re: psql not responding to SIGINT upon db reconnection
List pgsql-hackers
On 06/11/2023 19:16, Tristan Partin wrote:
>>> That sounds like a much better solution. Attached you will find a v4
>>> that implements your suggestion. Please let me know if there is
>>> something that I missed. I can confirm that the patch works.

This patch is missing a select(). It will busy loop until the connection 
is established or cancelled.

Shouldn't we also clear CancelRequested after we have cancelled the 
attempt? Otherwise, any subsequent attempts will immediately fail too.

Should we use 'cancel_pressed' here rather than CancelRequested? To be 
honest, I don't understand the difference, so that's a genuine question. 
There was an attempt at unifying them in the past but it was reverted in 
commit 5d43c3c54d.

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




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [HACKERS] Should logtape.c blocks be of type long?
Next
From: Tom Lane
Date:
Subject: Re: BUG #18097: Immutable expression not allowed in generated at