Re: [ADMIN] recovery is stuck when children are not processing SIGQUIT from previous crash

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Marko Kreen <markokr(at)gmail(dot)com>
Subject: Re: [ADMIN] recovery is stuck when children are not processing SIGQUIT from previous crash
Date: 2009-12-16 16:35:53
Message-ID: 5279.1260981353@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Here is a set of patches to address this issue.
> The first one is a small refactoring of the signal setting portability
> business.

OK

> The second one fixes the SIGQUIT handler inadvertently unblocking
> SIGQUIT within itself.

OK

> The third one installs an alarm so that if the ereport() call in
> quickdie() doesn't finish after 60 seconds, it skips it and finishes up.
> The precise logic of this could be debated, but it more or less appears
> to get the job done.

I'm not too happy with depending on alarm(), which according to the
pgbench sources is not portable to Windows. The postmaster does
something equivalent using enable_sig_alarm(); can we use that?

A different line of thought is that this still doesn't fix the problem
because you're depending on a fair amount of libc infrastructure that
might not be too reentrant (and the same objection could probably be
mounted against enable_sig_alarm). It would be better for the
postmaster to be in charge of enforcing the timeout, and have it issue
SIGKILL against children that don't die fast enough to suit it.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bill MacArthur 2009-12-16 17:45:39 identify referential integrity triggers unassociated with foreign key constraints
Previous Message Alvaro Herrera 2009-12-16 15:55:49 Re: [ADMIN] recovery is stuck when children are not processing SIGQUIT from previous crash

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-12-16 16:40:43 Re: Patch: Remove gcc dependency in definition of inline functions
Previous Message Marko Kreen 2009-12-16 16:24:34 Re: Patch: Remove gcc dependency in definition of inline functions