Totally new to the Erlang ecosystem (by way of Elixir), but are remote module loading meant to be performed in production? (I imagine so! To not take down live servers while they’re running, etc). The sync:patch README mentions that it’s only for development use, and not production. Why is that?
Replacing the beam just changes the implementation that is called when a:foo() is executed. It doesn’t change the state, and it doesn’t call stop/start, and it doesn’t know which state should be preserved. These things are handled by the release system (which felixgallo already linked you to and you should read).
You can in fact, use sync to upgrade your production systems (I do), but you have to really understand what it’s doing, and organise your programs so that you don’t have start/stop (or don’t need to change them), otherwise you’re going to break stuff and have a bad day.
Interesting that this is basically the same as jvm classloaders. The jvm is a nice piece of engineering with very few peers when it comes to introspectability and high performance dynamic stuff. It’s a shame it’s tied to the java ecosystem and associated with the java language.
You like this? You’ll love sync:patch
Now that is just plain nifty.
Totally new to the Erlang ecosystem (by way of Elixir), but are remote module loading meant to be performed in production? (I imagine so! To not take down live servers while they’re running, etc). The
sync:patchREADME mentions that it’s only for development use, and not production. Why is that?sync is really a dev tool, not a prod tool.
To update releases in production, you use the otp release handling process (http://erlang.org/doc/design_principles/release_handling.html) which is a lot more involved, but is also significantly safer.
Many thanks for that doc!
Replacing the beam just changes the implementation that is called when a:foo() is executed. It doesn’t change the state, and it doesn’t call stop/start, and it doesn’t know which state should be preserved. These things are handled by the release system (which felixgallo already linked you to and you should read).
You can in fact, use sync to upgrade your production systems (I do), but you have to really understand what it’s doing, and organise your programs so that you don’t have start/stop (or don’t need to change them), otherwise you’re going to break stuff and have a bad day.
Interesting that this is basically the same as jvm classloaders. The jvm is a nice piece of engineering with very few peers when it comes to introspectability and high performance dynamic stuff. It’s a shame it’s tied to the java ecosystem and associated with the java language.
Graal / Truffle let you reuse the jvm.