Re: Printing backtrace of postgres processes

Started by bt21tanigawayover 4 years ago2 messages
#1bt21tanigaway
bt21tanigaway@oss.nttdata.com

Hi,

The previous patch was failing because of the recent test changes made
by commit 201a76183e2 which unified new and get_new_node, attached
patch has the changes to handle the changes accordingly.
Thanks for your update!
I have two comments.

1.Do we need “set_backtrace(NULL, 0);” on “HandleMainLoopInterrupts()”?
I could observe that it works correctly without this. It is written on
“HandleAutoVacLauncherInterrupts” as well, but I think it is necessary
to prevent delays as well as [1]https://commitfest.postgresql.org/35/3342/.

2.The patch seems to forget to handle
“ereport(LOG,(errmsg("logging backtrace of PID %d", MyProcPid)));” on
“HandleAutoVacLauncherInterrupts” and “HandleMainLoopInterrupts()”.
I think it should be the same as the process on “ProcessInterrupts()”.

3.How about creating a new function.
Since the same process is on three functions( “ProcessInterrupts()”,
“HandleAutoVacLauncherInterrupts”, “HandleMainLoopInterrupts()” ), I
think it’s good to create a new function.

[1]: https://commitfest.postgresql.org/35/3342/

Regards,
Koyu Tanigawa

#2vignesh C
vignesh21@gmail.com
In reply to: bt21tanigaway (#1)

On Tue, Oct 12, 2021 at 10:47 AM bt21tanigaway
<bt21tanigaway@oss.nttdata.com> wrote:

Hi,

The previous patch was failing because of the recent test changes made
by commit 201a76183e2 which unified new and get_new_node, attached
patch has the changes to handle the changes accordingly.
Thanks for your update!
I have two comments.

1.Do we need “set_backtrace(NULL, 0);” on “HandleMainLoopInterrupts()”?
I could observe that it works correctly without this. It is written on
“HandleAutoVacLauncherInterrupts” as well, but I think it is necessary
to prevent delays as well as [1].

I have removed this from HandleMainLoopInterrupts

2.The patch seems to forget to handle
“ereport(LOG,(errmsg("logging backtrace of PID %d", MyProcPid)));” on
“HandleAutoVacLauncherInterrupts” and “HandleMainLoopInterrupts()”.
I think it should be the same as the process on “ProcessInterrupts()”.

I have create ProcessPrintBacktraceInterrupt which has the
implementation and is called wherever required. It is handled now.

3.How about creating a new function.
Since the same process is on three functions( “ProcessInterrupts()”,
“HandleAutoVacLauncherInterrupts”, “HandleMainLoopInterrupts()” ), I
think it’s good to create a new function.

I have created ProcessPrintBacktraceInterrupt to handle it.

Thanks for the comments, v9 patch attached at [1]/messages/by-id/CALDaNm3MGVP_WK1Uuf=BiAJ9PeVOfciwLy0mrFA1JNbRp99VOQ@mail.gmail.com has the changes for the same.
[1]: /messages/by-id/CALDaNm3MGVP_WK1Uuf=BiAJ9PeVOfciwLy0mrFA1JNbRp99VOQ@mail.gmail.com

Regards,
Vignesh