Re: Function to kill backend

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <josh(at)agliodbs(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Function to kill backend
Date: 2004-04-05 09:05:53
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE17163B@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > In this case, SIGINT (query cancel) will not help, because
> all locks
> > held by the transaction will still be held.
>
> Wrong.

Really?
Please point out where I am wrong in this:

SESSION A: BEGIN TRANSACTION
SESSION A: LOCK TABLE foo IN ACCESS EXCLUSIVE MODE
SESSION B: SELECT * FROM foo <-- blocks (expected)!
not-in-session: KILL -INT <pid_of_session_A>
(at this point, <pid_of_session_A> is listed as "idle in transaction")
SESSION B: <-- still blcoks....
SESSION A: ROLLBACK
SESSION B: <-- now completes

If I kill it with TERM instead of INT, SESSION B is released at that
point.

Am I missing something very obvious here?

This is on:
PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC 2.95.3

//Magnus

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2004-04-05 09:37:35 Re: i18n of PostgreSQL - part 1
Previous Message Dennis Bjorklund 2004-04-05 06:40:40 Regression from 7.3 to 7.4