Re: UNLISTEN bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: UNLISTEN bug
Date
Msg-id 3808.1285275875@sss.pgh.pa.us
Whole thread Raw
In response to UNLISTEN bug  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-bugs
Jeff Davis <pgsql@j-davis.com> writes:
> The bug is pretty simple: ProcessIncomingNotify() is called in a tight
> loop in EnableNotifyInterrupt() while notifyInterruptOccurred is true.
> EnableNotifyInterrupt() is assuming that ProcessIncomingNotify() will
> unset it, but it has an early return that's triggered by my UNLISTEN.

> Simply adding an additional "notifyInterruptOccurred = 0" in the early
> return path (patch attached) seems to work. I added it there rather than
> moving the whole line up, because I wasn't sure if it's safe to do that
> before DisableCatchupInterrupt().

Hm.  AFAICS just moving the flag reset up to the top is safe, and the
cleanest way to fix it.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Feature request - pg_dump - -W specify pwd in command line
Next
From: Peter Eisentraut
Date:
Subject: Re: libpq: system-wide root.crt