]> granicus.if.org Git - postgresql/commit
shm_mq: Fix failure to notice a dead counterparty when nowait is used.
authorRobert Haas <rhaas@postgresql.org>
Thu, 22 Oct 2015 20:33:30 +0000 (16:33 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 22 Oct 2015 20:40:00 +0000 (16:40 -0400)
commitac9a01615c5d45eb08e5b78c3d0155214e0ab498
tree57f0f711b83a161ce6e68d922f8cc8cd54aef69b
parent85e30f57cb33294107fc17704a5d8874439e0ae5
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.
src/backend/storage/ipc/shm_mq.c