Re: [PATCH] lock_timeout and common SIGALRM framework

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Marc Cousin <cousinmarc(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>, Ants Aasma <ants(at)cybertec(dot)at>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [PATCH] lock_timeout and common SIGALRM framework
Date: 2012-07-22 20:03:22
Message-ID: 500C5C8A.8030607@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012-07-17 06:32 keltezéssel, Alvaro Herrera írta:
> Excerpts from Tom Lane's message of vie jul 13 18:23:31 -0400 2012:
>> Boszormenyi Zoltan <zb(at)cybertec(dot)at> writes:
>>>>> Try SET deadlock_timeout = 0;
>> Actually, when I try that I get
>>
>> ERROR: 0 is outside the valid range for parameter "deadlock_timeout" (1 .. 2147483647)
>>
>> So I don't see any bug here.
> I committed this patch without changing this. If this needs patched,
> please speak up. I also considered adding a comment on
> enable_timeout_after about calling it with a delay of 0, but refrained;
> if anybody thinks it's necessary, suggestions are welcome.

Thanks for committing this part.

Attached is the revised (and a lot leaner, more generic) lock timeout patch,
which introduces new functionality for the timeout registration framework.
The new functionality is called "extra timeouts", better naming is welcome.
Instead of only the previously defined (deadlock and statement) timeouts,
the "extra" timeouts can also be activated from within ProcSleep() in a linked
way.

The lock timeout is a special case of this functionality. To show this, this patch
is split into two again to make reviewing easier.

This way, the timeout framework is really usable for external modules, as
envisioned by you guys

Also, rewriting statement and deadlock timeouts using this functionality
and unifying the two registration interfaces may be possible later. But
messing up proven and working code is not in the scope of this patch or
my job at this point.

Best regards,
Zoltán Böszörményi

--
----------------------------------
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/

Attachment Content-Type Size
1-timeout-framework-v19.patch text/x-patch 10.9 KB
2-lock_timeout-v19.patch text/x-patch 15.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-07-22 21:11:53 Re: isolation check takes a long time
Previous Message Tom Lane 2012-07-21 22:46:04 Re: [patch] libpq one-row-at-a-time API