Hi everyone.
I’ve been reading about the upcoming releases feature in 1.9. In the runtime configuration section, there is one paragraph that caught my attention. It basically suggests that the release in production is going through the following steps on boot:
- Erlang system starts in limited mode, without booting core app supervision tree
- Registered config providers are used to aggregate and merge configs into one big set
- Config set is stored on disk under the RELEASE_TMP directory
- Erlang system reboots in full mode, reads the config file and boots app supervision tree
If this is correct, I have a question. Why the file interaction? Why can’t we start a lightweight GenServer process or an agent within Beam and use it to store and retrieve the runtime configuration instead?
Can somebody please point me in direction of context I am missing?
1 Like
We can’t because the configuration is used to configure the system itself, at its core. So you can think that, at the moment the configuration is read, a GenServer isn’t even a thing yet.
4 Likes
I was under (probably wrong) impression that the configuration only impacts the userland processes and supervision trees.
If that (probably wrong) assumption was true, I imagined you can delay the boot of userland supervision trees and boot the separate config process, with its own supervisor, before starting the application, for example.
What you are saying is that there are some configs that go beyond just your userland supervision trees and impact the beam itself. Is it right?
Not the beam itself but the kernel and stdlib applications, which are started before everything else in your code.
Oh. I am starting to understand now.
Let me check I am getting it right. You are saying there are fundamental processes of Elixir stdlib and kernel that are booted as part of system load (not by user intention) and which can’t be reloaded without restarting the whole thing. Right?
Thank you for sticking with me on this one Very much appreciate your time and patience.
2 Likes