Re: implementing query timeout

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: implementing query timeout
Date: 2002-03-13 20:20:44
Message-ID: 200203132020.g2DKKiZ07685@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

Jessica Perry Hekman wrote:
> As has been noted on this list before, query timeouts are not implemented
> in pgsql-jdbc (see
>
> http://archives.postgresql.org/pgsql-bugs/2000-12/msg00093.php
>
> ). This is currently causing a problem for me, and I might (no
> promises) be interested in implementing it. So I'm testing the waters. If
> I did submit a patch for this, would the developers here be interested?

[ Hackers list added.]

You bet, but it would be done in the backend, not in jdbc. Is that OK?

I have some ideas that should make it pretty easy. If you set an
alarm() in the backend on transaction start, then call the query
cancel() code if the alarm() goes off, that should do it. Of course,
you reset the alarm if the query finishes before the timeout.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-03-13 20:22:37 Re: implementing query timeout
Previous Message Tom Lane 2002-03-13 20:01:39 Re: Zlib vulnerability heads-up.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Bruce Momjian 2002-03-13 20:22:37 Re: implementing query timeout
Previous Message Bruce Momjian 2002-03-13 20:10:05 Re: [PATCHES] minor error reporting fixes