Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-07 Thread Fujii Masao
On 2025/05/05 23:57, Robert Haas wrote: On Fri, May 2, 2025 at 9:54 PM Fujii Masao wrote: Thanks for the review and testing! I've fixed the issue you pointed out. Updated patch attached. Thanks for addressing this. However, I believe this commit may need to take note of the following commen

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-05 Thread Robert Haas
On Fri, May 2, 2025 at 9:54 PM Fujii Masao wrote: > Thanks for the review and testing! I've fixed the issue you pointed out. > Updated patch attached. Thanks for addressing this. However, I believe this commit may need to take note of the following comment from elog.h: * Note: if a local variab

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-02 Thread Fujii Masao
On 2025/05/02 14:58, torikoshia wrote: I confirmed that with this patch applied, the process no longer crashes even after applying the change Robert used to trigger the crash. a small nitpick: +    * requested  repeatedly and rapidly, potentially leading to infinite It looks li

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-01 Thread torikoshia
On 2025-05-02 09:02, Fujii Masao wrote: On 2025/05/02 2:27, Fujii Masao wrote: On 2025/05/01 21:42, Robert Haas wrote: On Thu, May 1, 2025 at 3:53 AM Fujii Masao wrote: Just idea, what do you think about adding a flag to indicate whether ProcessLogMemoryContextInterrupt() is currently runni

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-01 Thread Fujii Masao
On 2025/05/02 2:27, Fujii Masao wrote: On 2025/05/01 21:42, Robert Haas wrote: On Thu, May 1, 2025 at 3:53 AM Fujii Masao wrote: Just idea, what do you think about adding a flag to indicate whether ProcessLogMemoryContextInterrupt() is currently running? Then, when a backend receives a sig

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-01 Thread Fujii Masao
On 2025/05/01 21:42, Robert Haas wrote: On Thu, May 1, 2025 at 3:53 AM Fujii Masao wrote: Just idea, what do you think about adding a flag to indicate whether ProcessLogMemoryContextInterrupt() is currently running? Then, when a backend receives a signal and ProcessLogMemoryContextInterrupt(

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-01 Thread Robert Haas
On Thu, May 1, 2025 at 3:53 AM Fujii Masao wrote: > Just idea, what do you think about adding a flag to indicate whether > ProcessLogMemoryContextInterrupt() is currently running? Then, > when a backend receives a signal and ProcessLogMemoryContextInterrupt() > is invoked, it can simply return imm

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-05-01 Thread Fujii Masao
On 2025/05/01 2:15, Robert Haas wrote: On Tue, Apr 6, 2021 at 12:45 AM Fujii Masao wrote: Add function to log the memory contexts of specified backend process. Hi, I think this might need a recursion guard. I tried this: diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgre

Re: pgsql: Add function to log the memory contexts of specified backend pro

2025-04-30 Thread Robert Haas
On Tue, Apr 6, 2021 at 12:45 AM Fujii Masao wrote: > Add function to log the memory contexts of specified backend process. Hi, I think this might need a recursion guard. I tried this: diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index dc4c600922d..b219a934034 100644 --