pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix potential memory leakage from HandleParallelMessages(). 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix potential memory leakage from HandleParallelMessages(). @ 2016-08-26 19:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-26 19:04 UTC (permalink / raw) To: 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(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix potential memory leakage from HandleParallelMessages(). @ 2016-08-26 19:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-26 19:04 UTC (permalink / raw) To: 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 ------ REL9_6_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/bef2d627f30c0d854d02dc860b0d54fa3309d4ee Modified Files -------------- src/backend/access/transam/parallel.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix potential memory leakage from HandleParallelMessages(). @ 2016-08-26 19:04 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-26 19:04 UTC (permalink / raw) To: 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 ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/b09caece0df11266dd685187f4c86f452b378996 Modified Files -------------- src/backend/access/transam/parallel.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2016-08-26 19:04 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-08-26 19:04 pgsql: Fix potential memory leakage from HandleParallelMessages(). Tom Lane <tgl@sss.pgh.pa.us> 2016-08-26 19:04 pgsql: Fix potential memory leakage from HandleParallelMessages(). Tom Lane <tgl@sss.pgh.pa.us> 2016-08-26 19:04 pgsql: Fix potential memory leakage from HandleParallelMessages(). Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox