Re: [PATCH] lock_timeout and common SIGALRM framework - Mailing list pgsql-hackers

From Boszormenyi Zoltan
Subject Re: [PATCH] lock_timeout and common SIGALRM framework
Date
Msg-id 500C5C8A.8030607@cybertec.at
Whole thread Raw
In response to Re: [PATCH] lock_timeout and common SIGALRM framework  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: [PATCH] lock_timeout and common SIGALRM framework
List 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@cybertec.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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [patch] libpq one-row-at-a-time API
Next
From: Noah Misch
Date:
Subject: Re: isolation check takes a long time