Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()
Дата
Msg-id 6387.1472236121@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Aug 26, 2016 at 11:26 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm not quite sure what to do about this.  It feels a tad wrong to use
>> ErrorContext as the active context during HandleParallelMessages, but
>> what else should we use?  Maybe this needs its very own private context
>> that we can reset after each use?

> If we use ErrorContext, will anything go wrong?

I think it might, if we were unlucky enough to be doing this while the
leader was engaged in reporting some other error for its own reasons.
To avoid accumulated memory leakage over multiple worker error reports,
we ought to do a MemoryContextReset at the start or end (probably start)
of HandleParallelMessages, and that would be problematic if ErrorContext
had some data in it already.  It's possible that the scenario can't occur
because CHECK_FOR_INTERRUPTS is never done inside error processing, but
I would not feel very comfortable with that assumption.

I'm thinking a dedicated context is the way to go.  It won't take very
much code.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()
Следующее
От: Peter Eisentraut
Дата:
Сообщение: old_snapshot_threshold documentation