[postgis-devel] Interrupt on SIGTERM

Paul Ramsey pramsey at cleverelephant.ca
Mon Feb 22 10:18:45 PST 2021


So, thanks to Sandro's good works over past years we have reasonable handling of interrupts embedded in PostGIS and back into busy areas of GEOS too. But, the interrupt signal we respect is SIGINT, which is what you can generate with a ctrl-C in psql or hitting the stop button in pgadmin. This is good and works. However, for system SHUTDOWN, the signal the system sends is SIGTERM and we do... nothing with that signal. So a shutdown can be paused until a statement completes, which can be quite a while.

I'm not sure if we should interupt on SIGTERM. I am going back and forth just sitting here typing. I'm pretty sure PgSQL in general expects to allow all running statements to complete before shutting down, which implies not interrupting on SIGTERM. On the other hand, PgSQL has this OLTP assumption pretty deeply built in that most statements just aren't expected to last very long. 

Relevant ticket is here https://trac.osgeo.org/postgis/ticket/4857#comment:5

Opinions solicited.



More information about the postgis-devel mailing list