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

Add start_distribution to kernel environment #2088

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

josevalim
Copy link
Contributor

Sometimes you may want to start Erlang without any
of its distribution services. This commit adds an
environment configuration that allows so.

Because the servers we don't start here are a subset
of the servers not started on minimal mode, we do
have a guarantee that the system can still operate
as the system operates without those apps on minimal
mode.

@sirihansen sirihansen added the team:VM Assigned to OTP team VM label Jan 9, 2019
@josevalim
Copy link
Contributor Author

@sirihansen now that OTP 22-rc.1 is out, do you have any thoughts on this PR? I would love to get this on OTP 22 because it would be essential to allow us to configure releases with Elixir itself. Thank you.

@bjorng bjorng added the team:MW label Feb 28, 2019
@bjorng bjorng added the testing currently being tested, tag is used by OTP internal CI label Feb 28, 2019
@sirihansen
Copy link
Contributor

It would be really good to have some kind of test for this, to make sure we don't break it later on. Unless you have better ideas yourself, you could try either of

  • test_server:start_node/3 with Type=peer. This starts a node which communicates back over a tcp connection without trying to connect via erlang distribution. The drawback in this case is that you cannot talk to it afterwards without setting up an own communication way - i mean, to verify that it worked (which children exist under kernel_sup, maybe).
  • os:cmd/1 and print what you want to verify to stdout (which is then returned by os:cmd/1).

@josevalim
Copy link
Contributor Author

josevalim commented Mar 1, 2019

  • os:cmd/1 and print what you want to verify to stdout (which is then returned by os:cmd/1)

I assume something like done here?

Str = os:cmd(ct:get_progname()
++ " -noshell -pa "
++ proplists:get_value(data_dir, Config)
++ " -s run"),

Thanks @sirihansen!

@josevalim
Copy link
Contributor Author

@sirihansen pushed a test with os:cmd.

@sirihansen
Copy link
Contributor

Thanks! It'll run in tests over the weekend.

@sirihansen
Copy link
Contributor

The test runs nicely, but I just realized that it is in the emulator test and not in kernel (which is the affected application). Would you mind moving it to kernel_config_SUITE instead? (and please remove the comment here: https://github.com/erlang/otp/blob/master/lib/kernel/test/kernel_config_SUITE.erl#L62).

Sometimes you may want to start Erlang without any
of its distribution services. This commit adds an
environment configuration that allows so.

Because the servers we don't start here are a subset
of the servers not started on minimal mode, we do
have a guarantee that the system can still operate
as the system operates without those apps on minimal
mode.
@josevalim
Copy link
Contributor Author

@sirihansen done.

@sirihansen sirihansen merged commit 08030f4 into erlang:master Mar 8, 2019
@vans163
Copy link
Contributor

vans163 commented Mar 8, 2019

If we are going this way would like to add a note about EPMD, which presents problems as its always started by erlang as a daemon if its not running. This leads to weird behavior in things like supervised containers, as EPMD is part of the process tree, and when the VM dies, the supervisor still keeps thinking the tree is alive.

@josevalim
Copy link
Contributor Author

@vans163 you can pass -start_epmd false in such cases. Or explicitly start it before out of the tree. Is that not enough?

@josevalim josevalim deleted the jv-start-distribution branch March 8, 2019 15:41
@vans163
Copy link
Contributor

vans163 commented Mar 8, 2019

@josevalim its not because you also need to shim the EPMD implementation or you get an error when running a node with -start_epmd false, Protocol 'inet_tcp': register/listen error: econnrefused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants