Re: worker_spi shouldn't execute again on sigterm

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jeremy Finzel <finzelj(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: worker_spi shouldn't execute again on sigterm
Date: 2018-11-29 01:11:20
Message-ID: 20181129011120.GD626@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 28, 2018 at 09:55:37AM -0600, Jeremy Finzel wrote:
> I noticed that the way the test module worker_spi is written, it will
> execute the main loop SQL one more time after it gets a sigterm, THEN exit
> 1. This was surprising to me where I used this module as a pattern for my
> own background worker as I would have thought it should bail immediately
> without executing any more SQL.
>
> Shouldn't we add something like this line before it enters the phase where
> it starts the transaction and executes the SQL?

Yeah, I agree that this is a bad idea.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-11-29 01:17:39 Re: minor typo in dsa.c
Previous Message Sanyo Moura 2018-11-29 01:01:36 Re: Query with high planning time at version 11.1 compared versions 10.5 and 11.0