pgsql: shm_mq: Fix failure to notice a dead counterparty when nowait is

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: shm_mq: Fix failure to notice a dead counterparty when nowait is
Date: 2015-10-22 20:45:30
Message-ID: E1ZpMjq-00036o-Kq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

shm_mq: Fix failure to notice a dead counterparty when nowait is used.

The shm_mq mechanism was intended to optionally notice when the process
on the other end of the queue fails to attach to the queue. It does
this by allowing the user to pass a BackgroundWorkerHandle; if the
background worker in question is launched and dies without attaching
to the queue, then we know it never will. This logic works OK in
blocking mode, but when called with nowait = true we fail to notice
that this has happened due to an asymmetry in the logic. Repair.

Reported off-list by Rushabh Lathia. Patch by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b2ccb5f4e6c81305386edb34daf7d1d1e1ee112a

Modified Files
--------------
src/backend/storage/ipc/shm_mq.c | 48 ++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2015-10-22 21:06:04 pgsql: Add two missing cases to ATWrongRelkindError.
Previous Message Robert Haas 2015-10-22 18:55:34 pgsql: Fix typos in comments.