diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-11-03 09:12:52 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-11-03 09:18:26 -0500 |
commit | fd5ce6b89b63bdb9632a925a80f6f7d4e7bd2e00 (patch) | |
tree | 893088a263c1c94133e1468e77f0ae4caff5bd3e /src/backend/utils/adt/jsonb_gin.c | |
parent | 67d4738d934e9df455d2f67b2617423319b377d5 (diff) | |
download | postgresql-fd5ce6b89b63bdb9632a925a80f6f7d4e7bd2e00.tar.gz postgresql-fd5ce6b89b63bdb9632a925a80f6f7d4e7bd2e00.zip |
shm_mq: Third attempt at fixing nowait behavior in shm_mq_receive.
Commit a1480ec1d3bacb9acb08ec09f22bc25bc033115b purported to fix the
problems with commit b2ccb5f4e6c81305386edb34daf7d1d1e1ee112a, but it
didn't completely fix them. The problem is that the checks were
performed in the wrong order, leading to a race condition. If the
sender attached, sent a message, and detached after the receiver
called shm_mq_get_sender and before the receiver called
shm_mq_counterparty_gone, we'd incorrectly return SHM_MQ_DETACHED
before all messages were read. Repair by reversing the order of
operations, and add a long comment explaining why this new logic is
(hopefully) correct.
Diffstat (limited to 'src/backend/utils/adt/jsonb_gin.c')
0 files changed, 0 insertions, 0 deletions