Killed backend won't rollback transaction? - Mailing list pgsql-bugs

From SZŰCS Gábor
Subject Killed backend won't rollback transaction?
Date
Msg-id 013b01c4c347$195212c0$0403a8c0@fejleszt4
Whole thread Raw
Responses Re: Killed backend won't rollback transaction?
List pgsql-bugs
Dear Gurus,

Version: PostgreSQL 7.4.3 on Linux.

I have two transactions trying to insert the same value in a unique index
(pkey).
Tested and if I simpy try two plain sql backends, everything's ok. However,
mine is a silly scenario.

Obviously, the first one locks something (I assume the tuple) since the
other one goes waiting.

If I end this transaction (either by COMMIT or ROLLBACK), the other
transaction resumes (either by pkey violation error or successful insert).

BUT if I kill the first transaction (with standard (15 Terminate) signal),
the second one stucks in "waiting".

I know it's not recommended to "kill -9 the postmaster", but it's plain
"kill", and I couldn't circumvent it.
What happend is that I
* called a plpgsql function that inserted in this pkey, then
* called a C function that
* called system() that
* called php that inserted the same value via another connection, sentenced
to waiting.

The process hung, with no cancellation possible (the backend wrote "Cancel
request sent" but nothing happened -- system() ignores interrupts).

I fixed the lock, but I wondered if it's considered a bug.

TIA,
G.



pgsql-bugs by date:

Previous
From: Markus Bertheau
Date:
Subject: pg_ctl telling only half the truth
Next
From: "Luiz K. Matsumura"
Date:
Subject: Re: Bug in pgAdminIII or in pg 8 beta3 ?