Re: Use standard SIGHUP and SIGTERM handlers in autoprewarm module

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Craig Ringer <craig.ringer@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Robert Haas <robert.haas@enterprisedb.com>
Date: 2020-11-30T02:12:13Z
Lists: pgsql-hackers

On 2020/11/27 16:47, Bharath Rupireddy wrote:
> On Fri, Nov 27, 2020 at 12:26 PM Fujii Masao
> <masao.fujii@oss.nttdata.com> wrote:
>>
>>>   > > When I read the patch again, I found that, with the patch, the shutdown
>>>   > > of worker_spi causes to report the following FATAL message.
>>>   > >
>>>   > >      FATAL:  terminating connection due to administrator command
>>>   > >
>>>   > > Isn't this message confusing because it's not a connection? If so,
>>>   > > we need to update ProcessInterrupts() so that the proper message is
>>>   > > reported like other bgworkers do.
>>>   > >
>>>   >
>>>   > This is also true for all the bgworker that use the die() handler. How about doing it the way bgworker_die() does in ProcessInterrupts()? This would give meaningful information. Thoughts? If okay, I can make a separate patch.
>>>   >
>>>
>>> Attaching the patch that improved the message for bg workers in ProcessInterrupts(). For instance, now it looks like *FATAL:  terminating background worker "worker_spi" due to administrator command* or *FATAL:  terminating background worker "parallel worker" due to administrator command *and so on for other bg workers.*
>>> *
>>>
>>> Please review the patch.
>>
>> Thanks for the patch! It looks good to me.
>>
> 
> Thanks!

Pushed. Thanks!

Since all the patches that proposed in this thread were committed,
I marked the CF entry as committed.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



Commits

  1. Revert "Get rid of the dedicated latch for signaling the startup process".

  2. Improve log message about termination of background workers.

  3. Use standard SIGTERM signal handler die() in test_shm_mq worker.

  4. Use standard SIGHUP and SIGTERM signal handlers in worker_spi.

  5. Use standard SIGHUP and SIGTERM handlers in walreceiver.

  6. pg_prewarm: make autoprewarm leader use standard SIGHUP and SIGTERM handlers.

  7. Get rid of the dedicated latch for signaling the startup process.

  8. Use standard SIGHUP handler in syslogger.

  9. Use PostgresSigHupHandler in more places.

  10. Fix race condition with unprotected use of a latch pointer variable.

  11. Remove remnants of ImmediateInterruptOK handling.

  12. Introduce Streaming Replication.