Re: Using ProcSignal to get memory context stats from a runningbackend

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Using ProcSignal to get memory context stats from a runningbackend
Дата
Msg-id 20171212044330.3nclev2sfrab36tf@alap3.anarazel.de
обсуждение исходный текст
Ответ на Using ProcSignal to get memory context stats from a running backend  (Craig Ringer <craig@2ndquadrant.com>)
Ответы Re: Using ProcSignal to get memory context stats from a running backend  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Using ProcSignal to get memory context stats from a running backend  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Hi,

On 2017-12-12 11:57:41 +0800, Craig Ringer wrote:
> TL;DR: Lets add a ProcSignalReason that makes a backend
> call MemoryContextStats when it sees it and a C func that users can use to
> set it on a proc. Sane?

It's not unproblematic. procsignal_sigusr1_handler() runs in a signal
handler, so you can't really rely on a lot of stuff being legal to
do.

It'd be easy to set a flag in the handler and then have
CHECK_FOR_INTERRUPTS() do the MemoryContextStats() call. But that'd have
the disadvanatage that it possibly would take a while till the
MemoryContextStats() is executed. Not sure if that's still good enough
for you?

Another question is whether printing to stderr, bypassing proper
logging!, is good enough for something like this.

Greetings,

Andres Freund


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

Предыдущее
От: "Tsunakawa, Takayuki"
Дата:
Сообщение: RE: Using ProcSignal to get memory context stats from a runningbackend
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: [HACKERS] postgres_fdw super user checks