Re: Behaviour of bgworker with SIGHUP - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Behaviour of bgworker with SIGHUP
Date
Msg-id 20121231140353.GC4363@alvh.no-ip.org
Whole thread Raw
In response to Behaviour of bgworker with SIGHUP  (Guillaume Lelarge <guillaume@lelarge.info>)
Responses Re: Behaviour of bgworker with SIGHUP
List pgsql-hackers
Guillaume Lelarge wrote:
> Hi,
>
> Today, I tried to make fun with the new background worker processes in
> 9.3, but I found something disturbing, and need help to go further.

Thanks.

> Is it the work of the function (pointed by bgw_sighup) to get the new
> config values from the postmaster? and if so, how can I get these new
> values?

You probably want to have the sighup handler set a flag, and then call
ProcessConfigFile(PGC_SIGHUP) in your main loop when the flag is set.
Search for got_SIGHUP in postgres.c.

I think this (have a config option, and have SIGHUP work as expected)
would be useful to demo in worker_spi, if you care to submit a patch.

> I thought the configuration reloading would work just like a shared
> library but it doesn't seem so.

Yeah, you need to handle that manually, because you're running your own
process now.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: a width specification for s specifier (format function), fix behave when positional and ordered placeholders are used
Next
From: Greg Stark
Date:
Subject: Re: Making view dump/restore safe at the column-alias level