pg.conf re-reading in signal handler or at next return to main loop?

Started by Markus Bertheauabout 20 years ago6 messageshackers
Jump to latest
#1Markus Bertheau
mbertheau.pg@googlemail.com

Hi,

src/backend/utils/misc/README says

"
If SIGHUP is received, the GUC code rereads the postgresql.conf
configuration file (this does not happen in the signal handler, but at
next return to main loop; note that it can be executed while within a
transaction).
"

SIGHUP_handler() calls ProcessConfigFile() which calls
ParseConfigFile() which reads postgresql.conf.

For me that means that postgresql.conf in read in the signal handler,
which contradicts the claim in the README. Where's my error?

Markus Bertheau

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Markus Bertheau (#1)
Re: pg.conf re-reading in signal handler or at next return to main loop?

"Markus Bertheau" <mbertheau.pg@googlemail.com> writes:

SIGHUP_handler() calls ProcessConfigFile() which calls
ParseConfigFile() which reads postgresql.conf.

For me that means that postgresql.conf in read in the signal handler,
which contradicts the claim in the README. Where's my error?

The comment is referring to the control flow in a backend; you're
looking at the postmaster's sighup handler, which is different.

regards, tom lane

#3Markus Bertheau
mbertheau.pg@googlemail.com
In reply to: Tom Lane (#2)
Re: pg.conf re-reading in signal handler or at next return to main loop?

2006/3/6, Tom Lane <tgl@sss.pgh.pa.us>:

The comment is referring to the control flow in a backend; you're
looking at the postmaster's sighup handler, which is different.

Then the following comment patch is appropriate, afaics.

Markus Bertheau

Attachments:

guc-comment.patchtext/x-patch; charset=us-ascii; name=guc-comment.patchDownload+8-8
#4Bruce Momjian
bruce@momjian.us
In reply to: Markus Bertheau (#3)
Re: pg.conf re-reading in signal handler or at next return

Code comment patch applied. Thanks.

---------------------------------------------------------------------------

Markus Bertheau wrote:

2006/3/6, Tom Lane <tgl@sss.pgh.pa.us>:

The comment is referring to the control flow in a backend; you're
looking at the postmaster's sighup handler, which is different.

Then the following comment patch is appropriate, afaics.

Markus Bertheau

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#4)
Re: pg.conf re-reading in signal handler or at next return to main loop?

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Code comment patch applied. Thanks.

The comment was in fact correct as it stood, though in different ways
for the postmaster and backend --- in the postmaster it alludes to the
fact that we only enable signals at one point in the postmaster loop.

regards, tom lane

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#5)
Re: pg.conf re-reading in signal handler or at next return

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Code comment patch applied. Thanks.

The comment was in fact correct as it stood, though in different ways
for the postmaster and backend --- in the postmaster it alludes to the
fact that we only enable signals at one point in the postmaster loop.

OK, patch backed out.

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +