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

checking epmd is started without a crash #2278

Merged
merged 2 commits into from
May 5, 2020
Merged

checking epmd is started without a crash #2278

merged 2 commits into from
May 5, 2020

Conversation

shamis
Copy link
Contributor

@shamis shamis commented May 5, 2020

executing rebar3 shell when epmd is not running causes a crash log

=SUPERVISOR REPORT==== 5-May-2020::10:44:23.655292 ===
    supervisor: {local,net_sup}
    errorContext: start_error
    reason: {'EXIT',nodistribution}
    offender: [{pid,undefined},
               {id,net_kernel},
               {mfargs,{net_kernel,start_link,
                                   [['[email protected]',longnames],false]}},
               {restart_type,permanent},
               {shutdown,2000},
               {child_type,worker}]
=CRASH REPORT==== 5-May-2020::10:44:23.654275 ===
  crasher:
    initial call: net_kernel:init/1
    pid: <0.550.0>
    registered_name: []
    exception exit: {error,badarg}
      in function  gen_server:init_it/6 (gen_server.erl, line 358)
    ancestors: [net_sup,kernel_sup,<0.46.0>]
    message_queue_len: 0
    messages: []
    links: [#Port<0.49>,<0.547.0>]
    dictionary: [{longnames,true}]
    trap_exit: true
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 11369
  neighbours:

This PR checks if epmd is running using erl_epmd:names/0

@ferd
Copy link
Collaborator

ferd commented May 5, 2020

erl_epmd:names() is an undocumented function (and erl_epmd:names/1 was added in OTP-21 as per doc and can't be relied on). Did you try with net_adm:names/0 which should potentially be safer to use?

@shamis
Copy link
Contributor Author

shamis commented May 5, 2020

have changed to net_adm:names/0. It is working the same way as well

@ferd ferd merged commit fb58aa1 into erlang:master May 5, 2020
@shamis shamis deleted the patch-1 branch May 6, 2020 15:03
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.

2 participants