Re: Behaviour of bgworker with SIGHUP

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Behaviour of bgworker with SIGHUP
Дата
Msg-id 1356968938.1967.9.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: Behaviour of bgworker with SIGHUP  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Behaviour of bgworker with SIGHUP
Список pgsql-hackers
On Mon, 2012-12-31 at 11:03 -0300, Alvaro Herrera wrote:
> 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.
> 

Thanks for the tip. It works great.

> 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.
> 

Yeah, I would love too. Reading the code of worker_spi, we could add one
or three parameters: a naptime, and the schemaname for both bgprocess.
One would be enough or do you prefer all three?

> > 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.
> 

That makes sense, thanks.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Making view dump/restore safe at the column-alias level
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Behaviour of bgworker with SIGHUP