Re: psql not responding to SIGINT upon db reconnection

Tristan Partin <tristan@neon.tech>

From: "Tristan Partin" <tristan@neon.tech>
To: "Heikki Linnakangas" <hlinnaka@iki.fi>
Cc: "Tom Lane" <tgl@sss.pgh.pa.us>, <pgsql-hackers@postgresql.org>, "Shlok Kyal" <shlok.kyal.oss@gmail.com>
Date: 2023-12-05T18:35:31Z
Lists: pgsql-hackers

Attachments

On Wed Nov 29, 2023 at 11:48 AM CST, Tristan Partin wrote:
> I am not completely in love with the code I have written. Lots of 
> conditional compilation which makes it hard to read. Looking forward to 
> another round of review to see what y'all think.

Ok. Here is a patch which just uses select(2) with a timeout of 1s or 
pselect(2) if it is available. I also moved the state machine processing 
into its own function.

Thanks for your comments thus far.

-- 
Tristan Partin
Neon (https://neon.tech)

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix old, misleading comment for PGRES_POLLING_ACTIVE.

  2. Remove reachable call to pg_unreachable().

  3. Allow SIGINT to cancel psql database reconnections.

  4. Expose PQsocketPoll via libpq

  5. Fix query cancellation handling in psql