Re: psql not responding to SIGINT upon db reconnection

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: Tristan Partin <tristan(at)neon(dot)tech>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql not responding to SIGINT upon db reconnection
Date: 2023-07-24 17:00:06
Message-ID: CABwTF4ULmrh7v4oY2mjBEfj1LXU_3a10V30QxZfo1+10+z5=AQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 24, 2023 at 9:26 AM Tristan Partin <tristan(at)neon(dot)tech> wrote:

> attached patch

+ /*
+ * Restore the default SIGINT behavior while within libpq.
Otherwise, we
+ * can never exit from polling for the database connection. Failure to
+ * restore is non-fatal.
+ */
+ newact.sa_handler = SIG_DFL;
+ rc = sigaction(SIGINT, &newact, &oldact);

There's no action taken if rc != 0. It doesn't seem right to
continue as if everything's fine when the handler registration fails.
At least a warning is warranted, so that the user reports such
failures to the community.

Best regards,
Gurjeet
http://Gurje.et

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2023-07-24 17:09:05 Re: psql not responding to SIGINT upon db reconnection
Previous Message Andres Freund 2023-07-24 16:42:44 Re: [BUG] Crash on pgbench initialization.