pgsql: Fix potential memory leakage from HandleParallelMessages().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix potential memory leakage from HandleParallelMessages().
Дата
Msg-id E1bdMQU-0001rn-OM@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix potential memory leakage from HandleParallelMessages().

HandleParallelMessages leaked memory into the caller's context.  Since it's
called from ProcessInterrupts, there is basically zero certainty as to what
CurrentMemoryContext is, which means we could be leaking into long-lived
contexts.  Over the processing of many worker messages that would grow to
be a problem.  Things could be even worse than just a leak, if we happened
to service the interrupt while ErrorContext is current: elog.c thinks it
can reset that on its own whim, possibly yanking storage out from under
HandleParallelMessages.

Give HandleParallelMessages its own dedicated context instead, which we can
reset during each call to ensure there's no accumulation of wasted memory.

Discussion: <16610.1472222135@sss.pgh.pa.us>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/78dcd027e8f7ed213f69da932853dc4b7cb9cb44

Modified Files
--------------
src/backend/access/transam/parallel.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix potential memory leakage from HandleParallelMessages().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Add a nonlocalized version of the severity field to client error