From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: shm_mq: Fix detach race condition.
Date: Mon, 05 Mar 2018 20:16:18 +0000
Message-ID: <E1eswWw-0007Rc-ND@gemulon.postgresql.org> (raw)
shm_mq: Fix detach race condition.
Commit 34db06ef9a1d7f36391c64293bf1e0ce44a33915 adopted a lock-free
design for shm_mq.c, but it introduced a race condition that could
lose messages. When shm_mq_receive_bytes() detects that the other end
has detached, it must make sure that it has seen the final version of
mq_bytes_written, or it might miss a message sent before detaching.
Thomas Munro
Discussion: https://postgr.es/m/CAEepm%3D2myZ4qxpt1a%3DC%2BwEv3o188K13K3UvD-44FK0SdAzHy%2Bw%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/42d7074ebb832e511d1edec8091cd474d169eef1
Modified Files
--------------
src/backend/storage/ipc/shm_mq.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: rhaas@postgresql.org
Subject: Re: pgsql: shm_mq: Fix detach race condition.
In-Reply-To: <E1eswWw-0007Rc-ND@gemulon.postgresql.org>
References: <E1eswWw-0007Rc-ND@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox