Skip to content

Commit 71757a4

Browse files
authored
Merge pull request #18 from erszcz/master
Wait up to a minute on trace/1 and stop_tracing/1 calls
2 parents 60dedb6 + 1d6d1d7 commit 71757a4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/tr.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ trace(Modules) when is_list(Modules) ->
295295
trace(Opts) ->
296296
DefaultOpts = #{modules => [], pids => all,
297297
msg => none, msg_trigger => after_traced_call},
298-
gen_server:call(?MODULE, {start_trace, call, maps:merge(DefaultOpts, Opts)}).
298+
Timeout = timer:minutes(1),
299+
gen_server:call(?MODULE, {start_trace, call, maps:merge(DefaultOpts, Opts)}, Timeout).
299300

300301
%% @doc Starts tracing of the specified functions/modules in specific processes.
301302
-spec trace(module_spec(), pids()) -> ok | {error, already_tracing}.
@@ -307,7 +308,8 @@ trace(Modules, Pids) ->
307308
%% Any future messages from the Erlang tracer will be ignored.
308309
-spec stop_tracing() -> ok | {error, not_tracing}.
309310
stop_tracing() ->
310-
gen_server:call(?MODULE, {stop_trace, call}).
311+
Timeout = timer:minutes(1),
312+
gen_server:call(?MODULE, {stop_trace, call}, Timeout).
311313

312314
%% @doc Stops the whole `tr' server process.
313315
-spec stop() -> ok.

0 commit comments

Comments
 (0)