From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-committers(at)postgresql(dot)org |
Subject: | Re: pgsql: Check interrupts during logical decoding more frequently. |
Date: | 2014-06-30 15:23:00 |
Message-ID: | 20140630152300.GO26930@awork2.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
On 2014-06-30 10:10:24 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > Check interrupts during logical decoding more frequently.
>
> FWIW, I think it's usually better style to put CHECK_FOR_INTERRUPTS
> at the tops of loops rather than the bottoms. If you put it at the
> bottom, it's easily bypassed unintentionally by a "continue" somewhere
> in the middle of the loop body. (I suppose there could be cases where
> that's actually what you want, but if so some comments would be
> appropriate, because it's fragile coding.)
Ok. Will do so from now on.
I wanted to put it after the expensive/slow operation which makes the
check necessary - obviously putting it at the loop begin essentially has
the same effect, but that seemed clearer to me.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Noah Misch | 2014-06-30 21:06:14 | pgsql: Don't prematurely free the BufferAccessStrategy in pgstat_heap() |
Previous Message | Tom Lane | 2014-06-30 14:10:24 | Re: pgsql: Check interrupts during logical decoding more frequently. |