Skip site navigation (1) Skip section navigation (2)

Re: Behaviour of bgworker with SIGHUP

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Behaviour of bgworker with SIGHUP
Date: 2013-01-03 10:56:31
Message-ID: 1357210591.1964.22.camel@localhost.localdomain (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Mon, 2012-12-31 at 17:44 -0300, Alvaro Herrera wrote:
> Alvaro Herrera wrote:
> > Guillaume Lelarge wrote:
> > > On Mon, 2012-12-31 at 11:03 -0300, Alvaro Herrera wrote:
> > 
> > > > 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 got no problem with three.
> Actually, it occurs to me that it might be useful to demonstrate having
> the number of processes be configurable: so we could use just two
> settings, naptime and number of workers.  Have each worker just use a
> hardcoded schema, say "worker_spi_%d" or something like that.

Here you go.

worker_spi.naptime is the naptime between two checks.
worker_spi.total_workers is the number of workers to launch at
postmaster start time. The first one can change with a sighup, the last
one obviously needs a restart.


Attachment: worker_spi.patch
Description: text/x-patch (3.4 KB)

In response to


pgsql-hackers by date

Next:From: Hannu KrosingDate: 2013-01-03 11:19:06
Subject: Can't setval() a sequence to return the first value
Previous:From: Hannu KrosingDate: 2013-01-03 10:54:03
Subject: Re: Proposal: Store "timestamptz" of database creation on "pg_database"

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group