Converting pqsignal to void return - Mailing list pgsql-hackers

From Paul Ramsey
Subject Converting pqsignal to void return
Date
Msg-id 4E796D56-79B5-4447-9DA7-5428BC1A6B53@cleverelephant.ca
Whole thread Raw
Responses Re: Converting pqsignal to void return
Re: Converting pqsignal to void return
List pgsql-hackers
Nathan, 

I just ran across this change when a bunch of CI’s I run barfed. 


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. 


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 

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Pre-allocating WAL files
Next
From: Peter Eisentraut
Date:
Subject: Re: RFC: Additional Directory for Extensions