Re: pgsql: Check interrupts during logical decoding more frequently.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pgsql: Check interrupts during logical decoding more frequently.
Дата
Msg-id 20140630152300.GO26930@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: pgsql: Check interrupts during logical decoding more frequently.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
On 2014-06-30 10:10:24 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.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


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Check interrupts during logical decoding more frequently.
Следующее
От: Noah Misch
Дата:
Сообщение: pgsql: Don't prematurely free the BufferAccessStrategy in pgstat_heap()