4 ms·
Interesting to see that they mention loving the hot code reloading/upgrades, but also that they don't use the OTP release/upgrade functionality. I wonder what
by metabrew 16y ago
Interesting to see that they mention loving the hot code reloading/upgrades, but also that they don't use the OTP release/upgrade functionality.
I wonder what their process is.. Just coping over new .beams and loading them is fine for functional changes only, but you need a system to run code-upgrade hooks if you want to change the state being passed around.
- mononcqc 16y agoAs far as I know, you don't need releases and upgrade functionality to make use of the code-upgrade hooks. It simply works without them. Releases and upgrades do make it simpler to synchronize what needs to be taken down in what order, restarted, left alone, etc. But simple updates are still doable without that.
- metabrew 16y agoYes you can trigger updates just by doing this in most cases: sys:suspend(Pid), {module, my_module} = code:load_file(my_module), sys:change_code(Pid, my_module, undefined, [], 10000), sys:resume(Pid); But you still need a way to do that for running processes, something that release_handler does for you with real OTP releases by finding which pids are running for each module, by looking at supervisors and so on.
- jlouis 16y agoRight, the OTP upgrade system is best when you have few but very controlled upgrades of your application. If you alter the production system once every week, it is better to do something with lighter weight.
- metabrew 16y agoJust watched the video of the talk, "the reason we didn't use the otp release process is that the documentation was very obscure at the time..".