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

From Gurjeet Singh
Subject Re: psql not responding to SIGINT upon db reconnection
Date
Msg-id CABwTF4ULmrh7v4oY2mjBEfj1LXU_3a10V30QxZfo1+10+z5=AQ@mail.gmail.com
Whole thread Raw
In response to 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 Mon, Jul 24, 2023 at 9:26 AM Tristan Partin <tristan@neon.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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [BUG] Crash on pgbench initialization.
Next
From: "Tristan Partin"
Date:
Subject: Re: psql not responding to SIGINT upon db reconnection