Fix timeout issue when formatting large traces
Opened this issue · 1 comments
@jj1bdx you are right, I see I am not handling all the trace messages as I should. I don't think I really need those gc start and end events, so I will update the code accordingly so those events aren't logged.
For the issue you linked to, I do see the exception:
** exception exit: {timeout,
{gen_server,call,
[eflambe_server,
{stop_trace,#Ref<0.4056665575.1064304643.107444>}]}}
in function gen_server:call/2 (gen_server.erl, line 239)
in call from eflambe:stop_trace/1 (/Users/kenji/src/sfmt-erlang/_build/default/lib/eflambe/src/eflambe.erl, line 125)
in call from eflambe:apply/2 (/Users/kenji/src/sfmt-erlang/_build/default/lib/eflambe/src/eflambe.erl, line 87)
2> =ERROR REPORT==== 19-Oct-2021::12:49:34.479003 ===
** Generic server eflambe_server terminating
** Last message in was {stop_trace,#Ref<0.4056665575.1064304643.107444>}
** When Server state == {state,
[{trace,#Ref<0.4056665575.1064304643.107444>,1,1,
true,<0.249.0>,
[{open,speedscope}]}]}
** Reason for termination ==
** {{timeout,{gen_server,call,[<0.249.0>,finish]}},
[{gen_server,call,2,[{file,"gen_server.erl"},{line,239}]},
{eflambe_server,handle_call,3,
[{file,"/Users/kenji/src/sfmt-erlang/_build/default/lib/eflambe/src/eflambe_server.erl"},
{line,131}]},
{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,721}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,750}]}, �
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]}
** Client <0.238.0> is dead
And it looks like that gen server was currently executing this line when the timeout occurred - https://github.com/Stratus3D/eflambe/blob/master/src/eflambe_brendan_gregg.erl#L178. It's not clear to me why it timed out, but it could have been because the formatting was taking a while, which could have been caused by a large amount of trace data being collected. Does the sfmt_pure_tests:test_short_speed/0
function run for a long time? Either way I need to get this fixed. If formatting of trace data takes longer than the gen server timeout, you'll get this error. I need change the code so that an unlimited amount of time is permitted for trace formatting.
Originally posted by @Stratus3D in #1 (comment)
Re-open as explained in #4 (comment)