Re: [RFC] Should we fix postmaster to avoid slow shutdown? - Mailing list pgsql-hackers

From Tsunakawa, Takayuki
Subject Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Date
Msg-id 0A3221C70F24FB45833433255569204D1F638210@G01JPEXMBYT05
Whole thread Raw
In response to Re: [RFC] Should we fix postmaster to avoid slow shutdown?  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: [RFC] Should we fix postmaster to avoid slow shutdown?  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Ashutosh Bapat
> In pgstat_quickdie(), I think a call to sigaddset(&BlockSig, SIGQUIT) is
> missing before PG_SETMASK(). Although there are some SIGQUIT handlers which
> do not have that call. But I guess, it will be safer to have it.

I didn't add it because pgstat_quickdie() just exits, like some other postmaster children.  I thought those processes
whichare concerned about their termination processing call sigaddset(SIGQUIT), so I went after the processes who
aren't. Is this really necessary?
 

> Also, many other SIGQUIT handlers like bgworker_quickdie() call
> on_exit_reset() followed by exit(2) instead of just exit(1) in
> pgstat_quickdie(). Why is this difference?

As Robert and Tom said, either exit(1) or exit(2) is OK because reaper() handles non-zero exit code the same.
Regardingon_proc_reset(), stats collector is not attached to the shared memory and does not register on_proc_exit()
callbacks. These situations are the same as the archiver process, so I followed it.
 

Regards
Takayuki Tsunakawa


pgsql-hackers by date:

Previous
From: Julian Markwort
Date:
Subject: Re: [PATCH] pgpassfile connection option
Next
From: Amit Langote
Date:
Subject: Re: Declarative partitioning - another take