Re: putting a bgworker to rest

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: putting a bgworker to rest
Date: 2013-04-25 16:05:53
Message-ID: 20130425160553.GS2169@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> On 4/24/13 12:30 PM, Dimitri Fontaine wrote:
> > In Erlang, the lib that cares about such things in called OTP, and that
> > proposes a model of supervisor that knows when to restart a worker. The
> > specs for the restart behaviour are:
> >
> > Restart = permanent | transient | temporary
>
> There is also supervisord; see configuration settings "autorestart" and
> "exitcodes" here:
>
> http://supervisord.org/configuration.html#program-x-section-settings
>
> Yes, the feature creep is in full progress!

The main missing feature before this can be sensibly implemented, in my
view, is some way to make workers start when they are stopped, assuming
no intervening postmaster crash. I suppose we could write a
SQL-callable function so that a backend can signal postmaster to launch
a worker. For this to work, I think we need an SQL-accesible way to
list existing registered workers, along with whether they are running or
not, and some identifier. However, the list of registered workers and
their statuses currently only exists in postmaster local memory;
exporting that might be problematic. (Maybe a simple file with a list
of registered workers, but not the status, is good enough. Postmaster
could write it after registration is done.)

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-04-25 16:14:13 Re: danger of stats_temp_directory = /dev/shm
Previous Message Kyotaro HORIGUCHI 2013-04-25 15:56:53 Re: Failing start-up archive recovery at Standby mode in PG9.2.4