shm_mq fix for non-blocking mode

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: shm_mq fix for non-blocking mode
Date: 2015-10-16 21:08:26
Message-ID: CA+TgmobiDr2gcMTcSOg5VUzAweM-rRxf5KTz+BUeRpCyKvOEXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The shm_mq code handles blocking mode and non-blocking mode
asymmetrically in a couple of places, with the unfortunate result that
if you are using non-blocking mode, and your counterparty dies before
attaching the queue, operations on the queue continue to return
SHM_MQ_WOULD_BLOCK instead of, as they should, returning
SHM_MQ_DETACHED. The attached patch fixes the problem. Thanks to my
colleague Rushabh Lathia for helping track this down.

(There's are some further bugs in this area outside the shm_mq code
... but I'm still trying to figure out exactly what they are and what
we should do about them. This much, however, seems clear-cut.)

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
shm-mq-nonblock-fix.patch application/x-patch 2.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-10-16 21:11:58 Re: Parallel Seq Scan
Previous Message Tom Lane 2015-10-16 21:00:40 Re: plpython is broken for recursive use