Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress reporting of ergw_cluster startup process termination #426

Merged
merged 1 commit into from Aug 17, 2021

Conversation

0xAX
Copy link
Member

@0xAX 0xAX commented Aug 16, 2021

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:

2021-08-15T23:11:03.058973+06:00 <0.1050.0> error: crasher: initial call: ergw_cluster:'-fun.startup/0-'/0, pid: <0.1050.0>, 
registered_name: [], exit: {ok,[{ergw_cluster,startup,0,[{file,"/home/alex/work/ergw/apps/ergw_cluster/src/ergw_cluster.erl"},
{line,170}]},{proc_lib,init_p,3,[{file,"proc_lib.erl"},{line,211}]}]}, ancestors: [ergw_cluster,ergw_cluster_sup,<0.1047.0>], 
message_queue_len: 0, messages: [], links: [<0.1049.0>], dictionary: [], trap_exit: false, status: running, heap_size: 376, 
stack_size: 29, reductions: 151; neighbours:

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.

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.
@0xAX 0xAX requested a review from a team as a code owner August 16, 2021 07:04
Copy link
Contributor

@vkatsuba vkatsuba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@vkatsuba vkatsuba merged commit bfe32a4 into master Aug 17, 2021
@vkatsuba vkatsuba deleted the suppress-exit-repoting branch August 17, 2021 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants