pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Simon Riggs <simon@2ndQuadrant.com>
Cc: Daniel Migowski <dmigowski@ikoffice.de>
Cc: PostgreSQL - JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Deadlock detection
Date: Mon, 1 Jun 2009 19:30:55 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.0906011917360.27919@leary.csoft.net> (raw)
In-Reply-To: <4977D3DC.1080806@opencloud.com>
References: <1232531884.2327.342.camel@ebony.2ndQuadrant>
	<49771246.9020306@ikoffice.de>
	<1232583410.2327.704.camel@ebony.2ndQuadrant>
	<4977BB90.8090806@opencloud.com>
	<4977C8FD.7040204@opencloud.com>
	<4977D10A.9040706@opencloud.com>
	<Pine.BSO.4.64.0901212054040.3967@leary.csoft.net>
	<4977D3DC.1080806@opencloud.com>



On Thu, 22 Jan 2009, Oliver Jowett wrote:

> Kris Jurka wrote:
>>
>> On Thu, 22 Jan 2009, Oliver Jowett wrote:
>>>
>>> This passes the regression testsuite with antiDeadlock=true, but I don't
>>> have a deadlock testcase on hand to try unfortunately.
>>>
>>
>> This has a test case which deadlocks consistently:
>>
>> http://archives.postgresql.org/pgsql-jdbc/2008-10/msg00045.php
>
> Perfect, thanks
>
> My changes seem to pass BatchDeadLock with antiDeadlock=true (and still
> hang with antiDeadlock=false):

I'm not really sure what to do with this code.  It does two different 
things and what is does best really wasn't the thrust of this thread.

1) It avoids deadlocks by buffering the writes in local memory.  That's 
great, but wasn't really the point of the thread.  Would we suggest people 
run with antiDeadlock=true in a production environment to avoid deadlocks? 
If so, why wouldn't it be the default.

2) It warns when a deadlock has potentially occurred with stack trace 
information to provide the call location.  That's good, but it can't be 
100% accurate.  With a small timeout it may warn when there wouldn't be an 
actual deadlock and with a large timeout it may not warn when the call 
would have deadlocked without the intermediate buffer.  Having the 
intermediate buffer means that you aren't testing the same thing, so a 
success with antiDeadlock=true has no implications as to whether your 
application will deadlock with it turned off.  Previously it was discussed 
that you'd really want to cap the buffer size, so perhaps relating the 
maximum buffer size to Socket.getSendBufferSize might make the results of 
testing with antiDeadlock more representative of the behavior with it 
turned off.

So it's a useful piece of code, but I'm not sure what context it should 
really be used in.  Is anyone using this?  For what purpose?

Kris Jurka



view thread (4+ messages)  latest in thread

Message-ID: <alpine.BSO.2.00.0906011917360.27919@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.0906011917360.27919@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.0906011917360.27919@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, oliver@opencloud.com, simon@2ndQuadrant.com, dmigowski@ikoffice.de
  Subject: Re: Deadlock detection
  In-Reply-To: <alpine.BSO.2.00.0906011917360.27919@leary.csoft.net>
  References: <1232531884.2327.342.camel@ebony.2ndQuadrant> <49771246.9020306@ikoffice.de> <1232583410.2327.704.camel@ebony.2ndQuadrant> <4977BB90.8090806@opencloud.com> <4977C8FD.7040204@opencloud.com> <4977D10A.9040706@opencloud.com> <Pine.BSO.4.64.0901212054040.3967@leary.csoft.net> <4977D3DC.1080806@opencloud.com> <alpine.BSO.2.00.0906011917360.27919@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