Re: [PATCH] lock_timeout and common SIGALRM framework
Boszormenyi Zoltan <zb@cybertec.at>
From: Boszormenyi Zoltan <zb@cybertec.at>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Marc Cousin <cousinmarc@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>, Hans-Juergen Schoenig <hs@cybertec.at>, Ants Aasma <ants@cybertec.at>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2012-07-04T18:36:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix Windows implementation of PGSemaphoreLock.
- ada8fa08fc6c 9.2.0 cited
Attachments
- 1-timeout-framework-v15.patch (text/x-patch) patch v15
- 2-lock_timeout-v15.patch (text/x-patch) patch v15
2012-07-04 17:20 keltezéssel, Alvaro Herrera írta:
> Excerpts from Boszormenyi Zoltan's message of mié jul 04 06:32:46 -0400 2012:
>> 2012-07-04 12:09 keltezéssel, Boszormenyi Zoltan írta:
>>> You just broke initdb with this cleanup. :-)
> Ouch.
>
>>> initdb starts postgres --single, that doesn't do BackendInitialize(),
>>> only PostgresMain(). So, you need InitializeTimeouts() before
>>> the RegisterTimeout() calls in PostgresMain and the elog(PANIC)
>>> must not be in InitializeTimeouts() if called twice.
>> Attached is the fix for this problem. PostgresMain() has a new
>> argument: bool single_user. This way, InitializeTimeouts() can
>> keep its elog(PANIC) if called twice and "postgres --single"
>> doesn't fail its Assert() in RegisterTimeout().
> Hmm. Maybe it's better to leave InitializeTimeouts to be called twice
> after all. The fix seems a lot uglier than the disease it's curing.
Attached are the refreshed patches. InitializeTimeouts() can be called
twice and PGSemaphoreTimedLock() returns bool now. This saves
two calls to get_timeout_indicator().
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/