Home > Archive > PostgreSQL JDBC > December 2005 > Re: Statement.cancel() race condition









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Statement.cancel() race condition
Kris Jurka

2005-12-01, 8:24 pm



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/pgsq...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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Kris Jurka

2005-12-02, 3:24 am



On Thu, 1 Dec 2005, Kris Jurka wrote:

> On Thu, 1 Dec 2005, Kevin Grittner wrote:
>
>
> I think taking the ReceiveEOF portion of this patch:
>
> http://archives.postgresql.org/pgsq...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.
>


I've applied this fix for single threaded applications to 8.0, 8.1 and
HEAD. The multi-threaded stuff is more complicated than I'd like to get
into at the moment.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com