Re: BUG #5036: Advisory locks have unexpected behavior

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Dennis Seran <dseran(at)novonics(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5036: Advisory locks have unexpected behavior
Date: 2009-09-04 15:50:55
Message-ID: 20090904155055.GF5603@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dennis Seran wrote:

> - Client B again prompts the command pg_try_advisory_lock_shared(12345) in
> an attempt to reobtain the shared lock(12345) but returns false and fails to
> obtain the shared lock (SHOULDN'T THIS CLIENT BE ABLE TO OBTAIN THE SHARED
> LOCK?)

No; it gets to sleep until after client C has released the exclusive
lock. Otherwise a constant stream of shared lockers would starvate
exclusive lockers.

> - The above result happens when all 3 clients are on the same machine. If
> the same steps were followed, but this time with clients A and B on a RHEL
> machine and the client C and the server on an XP machine, the result is a
> bit different. The above step results in Client B going into the queue as
> well as Client C even though Client A currently holds the shared lock.
> (AGAIN, SHOULDN'T THIS CLIENT BE ABLE TO OBTAIN THE SHARED LOCK?)

I think this sounds like a bug.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2009-09-04 15:59:48 Re: BUG #5028: CASE returns ELSE value always when type is "char"
Previous Message Robert Haas 2009-09-04 15:50:25 Re: BUG #5028: CASE returns ELSE value always when type is "char"