pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Statement.cancel() race condition
Date: Thu, 1 Dec 2005 18:39:15 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0512011833110.24595@leary.csoft.net> (raw)
In-Reply-To: <438F2DE5.EE98.0025.0@wicourts.gov>
References: <438F2DE5.EE98.0025.0@wicourts.gov>



On Thu, 1 Dec 2005, Kevin Grittner wrote:

>
> The problem is that even after the exception comes out of this code, is
> caught, and the transaction is rolled back -- we are still often able to
> start another statement which is running by the time the server gets
> around to interrupting the related back end process.  Obviously, having
> the cancel of one statement actually interrupt the processing of a
> subsequent statement violates the popular principle of "least surprising
> result".
>

I think taking the ReceiveEOF portion of this patch:

http://archives.postgresql.org/pgsql-jdbc/2003-09/msg00175.php

would fix this in the single thread case.  The multi-threaded case is 
obviously more complicated.  I don't recall why the original patch wasn't 
committed.

Kris Jurka



view thread (3+ messages)  latest in thread

Message-ID: <Pine.BSO.4.61.0512011833110.24595@leary.csoft.net>
Permalink:  ../Pine.BSO.4.61.0512011833110.24595@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.61.0512011833110.24595@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, Kevin.Grittner@wicourts.gov
  Subject: Re: Statement.cancel() race condition
  In-Reply-To: <Pine.BSO.4.61.0512011833110.24595@leary.csoft.net>
  References: <438F2DE5.EE98.0025.0@wicourts.gov> <Pine.BSO.4.61.0512011833110.24595@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox