agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Petr Jelinek <[email protected]>
To: Robert Haas <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: shm_mq inconsistent behavior of SHM_MQ_DETACHED
Date: Mon, 28 Apr 2014 22:24:59 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoY3SF4d3tPa5wix1O4X-9viJ+fGz0ZpJX1=jYCW_2TQOg@mail.gmail.com>
References: <[email protected]>
	<CA+TgmoY3SF4d3tPa5wix1O4X-9viJ+fGz0ZpJX1=jYCW_2TQOg@mail.gmail.com>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-hackers>

On 28/04/14 15:36, Robert Haas wrote:
> On Tue, Apr 22, 2014 at 9:55 AM, Petr Jelinek <[email protected]> wrote:
>>
>> But if I do first receive after detach like in this sequence:
>> P1 -> set_sender
>> P1 -> attach
>> P2 -> set_receiver
>> P2 -> attach
>> P1 -> send
>> P1 -> send
>> P1 -> detach
>> P2 -> receive
>>
>> I get SHM_MQ_DETACHED on the receiver even though there are messages in the
>> ring buffer.
>
> That's a bug.
>
> I'm thinking that the problem is really revolves around
> shm_mq_wait_internal().  It returns true if the queue is attached but
> not detached, and false if either the detach has already happened, or
> if we establish via the background worker handle that it will never
> come.  But in the case of receiving, we want to treat
> attached-then-detached as a success case, not a failure case.
>
> Can you see if the attached patch fixes it?
>


Yes, the patch fixes it for me.


-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (5+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: shm_mq inconsistent behavior of SHM_MQ_DETACHED
  In-Reply-To: <[email protected]>

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

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