Re: timeout implementation issues - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: timeout implementation issues
Date
Msg-id 200204011748.g31Hmj629611@candle.pha.pa.us
Whole thread Raw
In response to timeout implementation issues  (Jessica Perry Hekman <jphekman@dynamicdiagrams.com>)
Responses Re: timeout implementation issues  (Jessica Perry Hekman <jphekman@dynamicdiagrams.com>)
List pgsql-hackers
Peter Eisentraut wrote:
> Bruce Momjian writes:
> 
> > I think there are two ways of making this capability visible to users.
> > First, you could do:
> >
> >     SET query_timeout = 5;
> >
> > and all queries after that would time out at 5 seconds.  Another option
> > is:
> >
> >     BEGIN WORK TIMEOUT 5;
> >     ...
> >     COMMIT;
> >
> > which would make the transaction timeout after 5 seconds.  We never
> > decided which one we wanted, or both.
> 
> Note that the first is a statement-level timeout and the second is a
> transaction-level timeout.  Be sure to clarify which one we want.

Oh, wow, that is an interesting distinction.  If there is a multi-query
transaction, do we time each query separately or the entire transaction?
I don't know which people want, and maybe this is why we need both GUC
and BEGIN WORK timeouts.  I don't remember this distinction in previous
discussions but it may be significant.  Of course, the GUC could behave
at a transaction level as well.  It will be tricky to manage multiple
alarms in a single process, but it can be done by creating an alarm
queue.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: timeout implementation issues
Next
From: Bruce Momjian
Date:
Subject: Re: timeout implementation issues