maximum number of backtrace frames logged by backtrace_functions

2022-02-01 Thread Fujii Masao
Hi, The maximum number of backtrace frames logged by backtrace_functions is 100. Isn't it better to document this information so that users can understand not all backtrace always can be logged? Patch attached. Regards, -- Fujii Masao Advanced Computing Technology Center Researc

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-01 Thread Peter Eisentraut
On 01.02.22 18:04, Fujii Masao wrote: The maximum number of backtrace frames logged by backtrace_functions is 100. Isn't it better to document this information so that users can understand not all backtrace always can be logged? Patch attached. The 100 was chosen as more than you'll

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-02 Thread Fujii Masao
On 2022/02/02 16:20, Peter Eisentraut wrote: On 01.02.22 18:04, Fujii Masao wrote: The maximum number of backtrace frames logged by backtrace_functions is 100. Isn't it better to document this information so that users can understand not all backtrace always can be logged? Patch att

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-03 Thread Peter Eisentraut
On 03.02.22 06:33, Fujii Masao wrote: I encountered the "more than 100 backtrace frames" case when investigating the bug of pg_log_query_plan() patch [1]. Since the function that the patch added can be called repeatedly during call to that function, the backtrace became larger than 100. I think

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-03 Thread Tom Lane
Peter Eisentraut writes: > How about we issue a message when the backtrace is cut off. Then it's > immediately visible to the user, instead of hidden away somewhere in the > documentation. Something like this (untested): +1 for idea (I didn't test it either). Is "nframes" useful enough to in

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-03 Thread Fujii Masao
On 2022/02/03 23:48, Tom Lane wrote: Peter Eisentraut writes: How about we issue a message when the backtrace is cut off. Then it's immediately visible to the user, instead of hidden away somewhere in the documentation. Something like this (untested): +1 for idea (I didn't test it either)

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-06 Thread Fujii Masao
On 2022/02/04 9:48, Fujii Masao wrote: On 2022/02/03 23:48, Tom Lane wrote: Peter Eisentraut writes: How about we issue a message when the backtrace is cut off.  Then it's immediately visible to the user, instead of hidden away somewhere in the documentation.  Something like this (unteste

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-07 Thread Peter Eisentraut
On 07.02.22 06:29, Fujii Masao wrote: On 2022/02/03 23:48, Tom Lane wrote: Peter Eisentraut writes: How about we issue a message when the backtrace is cut off.  Then it's immediately visible to the user, instead of hidden away somewhere in the documentation.  Something like this (untested):

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-07 Thread Fujii Masao
On 2022/02/08 1:12, Peter Eisentraut wrote: This change looks good to me.  There is also backtrace code in assert.c that might want the same treatment. Yeah, that's good idea! The attached patch also adds the same treatment into assert.c. Regards, -- Fujii Masao Advanced Computing Technol

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-17 Thread Peter Eisentraut
On 07.02.22 17:42, Fujii Masao wrote: On 2022/02/08 1:12, Peter Eisentraut wrote: This change looks good to me.  There is also backtrace code in assert.c that might want the same treatment. Yeah, that's good idea! The attached patch also adds the same treatment into assert.c. I don't know i

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-18 Thread Fujii Masao
On 2022/02/18 16:07, Peter Eisentraut wrote: On 07.02.22 17:42, Fujii Masao wrote: On 2022/02/08 1:12, Peter Eisentraut wrote: This change looks good to me.  There is also backtrace code in assert.c that might want the same treatment. Yeah, that's good idea! The attached patch also adds t

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-18 Thread Peter Eisentraut
On 18.02.22 09:24, Fujii Masao wrote: Or even backtrace should be logged by write_stderr() so that it's written to eventlog if necessary? I just wonder why backtrace_symbols_fd() is used only in ExceptionalCondition(). Probably because it was simpler. It would also make sense to convert the

Re: maximum number of backtrace frames logged by backtrace_functions

2022-02-18 Thread Fujii Masao
On 2022/02/18 19:59, Peter Eisentraut wrote: On 18.02.22 09:24, Fujii Masao wrote: Or even backtrace should be logged by write_stderr() so that it's written to eventlog if necessary? I just wonder why backtrace_symbols_fd() is used only in ExceptionalCondition(). Probably because it was si

Re: maximum number of backtrace frames logged by backtrace_functions

2022-03-01 Thread Yugo NAGATA
On Sat, 19 Feb 2022 01:05:04 +0900 Fujii Masao wrote: > > > On 2022/02/18 19:59, Peter Eisentraut wrote: > > On 18.02.22 09:24, Fujii Masao wrote: > >> Or even backtrace should be logged by write_stderr() so that it's written > >> to eventlog if necessary? I just wonder why backtrace_symbols_f

Re: maximum number of backtrace frames logged by backtrace_functions

2022-03-23 Thread Peter Eisentraut
On 18.02.22 17:05, Fujii Masao wrote: Or even backtrace should be logged by write_stderr() so that it's written to eventlog if necessary? I just wonder why backtrace_symbols_fd() is used only in ExceptionalCondition(). Probably because it was simpler.  It would also make sense to convert the