Interrupt on SIGTERM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Interrupt on SIGTERM

Paul Ramsey
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.

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: Interrupt on SIGTERM

Paul Ramsey
Sold.

On Mon, Feb 22, 2021 at 10:28 AM Darafei "Komяpa" Praliaskouski <[hidden email]> wrote:
We should follow the signals in the Postgres doc:
https://www.postgresql.org/docs/13/server-shutdown.html 

If someone wants fast shutdown they should issue a fast shutdown command which will trigger SIGINT which we handle. Recommended course of action is to change the shutdown method to fast rather than hacking postgis to support fast shutdown in smart mode.

On Mon, Feb 22, 2021 at 9:18 PM Paul Ramsey <[hidden email]> wrote:
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.

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel


--
Darafei "Komяpa" Praliaskouski
OSM BY Team - http://openstreetmap.by/
_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel