public inbox for [email protected]
help / color / mirror / Atom feedFrom: Paul Ramsey <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Cc: Nathan Bossart <[email protected]>
Subject: Converting pqsignal to void return
Date: Wed, 22 Jan 2025 07:57:52 -0800
Message-ID: <[email protected]> (raw)
Nathan,
I just ran across this change when a bunch of CI’s I run barfed.
https://github.com/postgres/postgres/commit/d4a43b283751b23d32bbfa1ecc2cad2d16e3dde9
The problem we are having in extension land is that we often run functions in external libraries that take a long time to return, and we would like to ensure that PgSQL users can cancel their queries, even when control has passed into those functions.
The way we have done it, historically, has been to take the return value of pqsignal(SIGINT, extension_signint_handler) and remember it, and then, inside extension_signint_handler, call the pgsql handler once we have done our own business.
https://github.com/pramsey/pgsql-http/blob/master/http.c#L345
It is possible we have been Doing It Wrong all this time, and would love some pointers on the right way to do this.
Alternatively, if we have a valid use case, it would be nice to have the return value from pqsignal() back.
Thanks!
Paul
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Converting pqsignal to void return
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox