Fix for rare race-condition-like failure: if a backend receives SIGUSR2

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 53e95eee84e0f8c680ad813091e7226abb24214e
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2002-09-16T01:24:41Z
Releases: 7.3.1
Fix for rare race-condition-like failure: if a backend receives SIGUSR2
(notify/SI-overrun interrupt) while it is in process of doing proc_exit,
it is possible for Async_NotifyHandler() to try to start a transaction
when one is already running.  This leads to Asserts() or worse.  I think
it may only be possible to occur when frontend synchronization is lost
(ie, the elog(FATAL) in SocketBackend() fires), but that is a standard
occurrence after error during COPY.  In any case, I have seen this
failure occur during regression tests, so it is definitely possible.

Files

PathChange+/−
src/backend/commands/async.c modified +5 −1
src/backend/tcop/postgres.c modified +5 −2