Skip to content

Commit

Permalink
Suppress reporting of ergw_cluster startup process termination
Browse files Browse the repository at this point in the history
At startup of ergw_cluster process it creates a special process to
be sure that Erlang runtime fully started before ergw_cluster may
start to do its job. After that the special process done with its
job we terminate it with exit(ok) and this event is reported to log.

According to proc_lib documentation:

> When a process that is started using proc_lib terminates abnormally
  (that is, with another exit reason than normal, shutdown, or {shutdown,Term}),
  a crash report is generated, which is written to terminal by the default
  logger handler setup by Kernel

This commit replaces proc_lib:spawn_link/1 with erlang:spawn_link/1 to get rid
of this report in console. There is no sense to have this report in logs as
anyway the exit signal will be handled by the ergw_cluster process.
  • Loading branch information
0xAX authored and vkatsuba committed Aug 17, 2021
1 parent 0a679ce commit bfe32a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/ergw_cluster/src/ergw_cluster.erl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ init([]) ->
process_flag(trap_exit, true),
Now = erlang:monotonic_time(),

Pid = proc_lib:spawn_link(fun startup/0),
Pid = spawn_link(fun startup/0),
{ok, startup, #{init => Now, startup => Pid}}.

handle_event({call, From}, wait_till_ready, State, _Data)
Expand Down

0 comments on commit bfe32a4

Please sign in to comment.