mirror of https://github.com/postgres/postgres
Commitpull/10/heada1480ec1d3
purported to fix the problems with commitb2ccb5f4e6
, 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.
parent
0279f62fdc
commit
4efe26cbd3
Loading…
Reference in new issue