View Source AntikytheraCore.Release.Appup (antikythera v0.5.1)
Generates a .appup file for the given application, start version, and upgrade version.
The appup file generated by make/5
is much simpler than that by similar appup generation tools,
as make/5
does not use update
instruction (which is called "synchronized code replacement").
Synchronized code replacement (which uses code_change/3
) is risky because
- It's difficult to get it right, difficult to test.
- Suspending target processes entails traversing the whole supervision tree.
All processes in the tree must respond to system messages in a timely manner.
- Processes governed by some libraries might not properly handle system messages;
if it's the case all OTP applications will be restarted by
:init.restart()
. - Some process might not respond in a timely fashion; resulting in brutal kill of the unresponsive process.
- Suspending handling of non-system messages might cause performance issues.
- Processes governed by some libraries might not properly handle system messages;
if it's the case all OTP applications will be restarted by
Therefore we simply don't use OTP's code change mechanism; to change data format of process state we
- implement callbacks to check/convert the data format version, or
- avoid hot code upgrade and replace the working instances with new ones.
On the other hand, make/5
automatically resolves interdependencies between changed modules (which other tools don't).
Parameters for make/5
name
: the application name as an atomv1
: the start version, such as "0.0.1"v2
: the upgrade version, such as "0.0.2"v1_dir
: the path to the v1 artifacts (rel/<app>/lib/<app>-0.0.1)v2_dir
: the path to the v2 artifacts (_build/prod/lib/<app>)