Re: bgworker crashed or not? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: bgworker crashed or not?
Date
Msg-id 30853.1391440857@sss.pgh.pa.us
Whole thread Raw
In response to Re: bgworker crashed or not?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: bgworker crashed or not?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> This is admittedly a weird API, and we've had some discussion of
> whether to change it, but I don't know that we've reached any final
> conclusion.  I'm tempted to propose exactly inverting the current
> meaning of exit(0).  That is, make it mean "don't restart me, ever,
> even if I have a restart interval configured" rather than "restart me
> right away, even if I have a restart interval configured".  That way,
> a background process that wants to run until it accomplishes some task
> could be written to exit(1) on error and exit(0) on success, which
> seems quite natural.

Soexit(0)    - done, permanentlyexit(1) - done until restart intervalexit(other) - crash
and there's no way to obtain the "restart immediately" behavior?

I think this is an improvement, but it probably depends on what
you think the use-cases are for bgworkers.  I can definitely see
that there is a need for a bgworker to be just plain done, though.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: bgworker crashed or not?
Next
From: Merlin Moncure
Date:
Subject: Re: jsonb and nested hstore