From: | Petr Jelinek <petr(at)2ndquadrant(dot)com> |
---|---|
To: | Petr Jelinek <petr(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Craig Ringer <craig(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Antonin Houska <antonin(dot)houska(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com> |
Subject: | Re: bgworker crashed or not? |
Date: | 2014-05-07 14:25:46 |
Message-ID: | 536A426A.9080708@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 07/05/14 02:25, Petr Jelinek wrote:
> On 06/05/14 19:05, Robert Haas wrote:
>> What I'm inclined to do is change the logic so that:
>>
>> (1) After a crash-and-restart sequence, zero rw->rw_crashed_at, so
>> that anything which is still registered gets restarted immediately.
>
> Yes, that's quite obvious change which I missed completely :).
>
>> (2) If a shmem-connected backend fails to release the deadman switch
>> or exits with an exit code other than 0 or 1, we crash-and-restart. A
>> non-shmem-connected backend never causes a crash-and-restart.
>
> +1
>
>> (3) When a background worker exits without triggering a
>> crash-and-restart, an exit code of precisely 0 causes the worker to be
>> unregistered; any other exit code has no special effect, so
>> bgw_restart_time controls.
>
> +1
>
Ok, attached patch is my try at the proposed changes.
I don't like the reset_bgworker_crash_state function name, maybe you'll
come up with something better...
I passes my tests for the desired behavior, hopefully I didn't miss some
scenario.
--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Attachment | Content-Type | Size |
---|---|---|
unregister-bgworker-on-exit0-v3.diff | text/x-patch | 6.2 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2014-05-07 14:26:21 | Re: PGDLLEXPORTing all GUCs? |
Previous Message | Tom Lane | 2014-05-07 14:24:34 | Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers |