aboutsummaryrefslogtreecommitdiffstats
path: root/priv/templates
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2016-08-16 10:10:47 -0700
committerGitHub <[email protected]>2016-08-16 10:10:47 -0700
commit88db273ab872cc906b9102658b960a9f28998289 (patch)
tree366c92e5048b00b543598554b7cdf303bda5bd0c /priv/templates
parent9168eab9d949cb5fb3fe09b9e73cf404295e97ff (diff)
parentca8b20a9c7e7edd8ba27df809cb1eee060bf459b (diff)
downloadrelx-88db273ab872cc906b9102658b960a9f28998289.tar.gz
relx-88db273ab872cc906b9102658b960a9f28998289.tar.bz2
relx-88db273ab872cc906b9102658b960a9f28998289.zip
Merge pull request #502 from lrascao/feature/handle_soft_purge_error
Handle release_handler old_processes error when doing a soft purge relup
Diffstat (limited to 'priv/templates')
-rw-r--r--priv/templates/install_upgrade_escript13
1 files changed, 12 insertions, 1 deletions
diff --git a/priv/templates/install_upgrade_escript b/priv/templates/install_upgrade_escript
index 4abce85..0910c38 100644
--- a/priv/templates/install_upgrade_escript
+++ b/priv/templates/install_upgrade_escript
@@ -92,7 +92,18 @@ install_and_permafy(TargetNode, RelName, Vsn) ->
[io_lib:format("* ~s\t~s~n",[V,S]) || {V,S} <- which_releases(TargetNode)]),
?INFO("Installed versions:~n~s", [VerList]),
?INFO("ERROR: Unable to revert to '~s' - not installed.~n", [Vsn]),
- erlang:halt(2)
+ erlang:halt(2);
+ %% as described in http://erlang.org/doc/man/appup.html, when performing a relup
+ %% with soft purge:
+ %% If the value is soft_purge, release_handler:install_release/1
+ %% returns {error,{old_processes,Mod}}
+ {error, {old_processes, Mod}} ->
+ ?INFO("ERROR: unable to install '~s' - old processes still running code from module ~p~n",
+ [Vsn, Mod]),
+ erlang:halt(3);
+ {error, Reason1} ->
+ ?INFO("ERROR: release_handler:install_release failed: ~p~n",[Reason1]),
+ erlang:halt(4)
end.
permafy(TargetNode, RelName, Vsn) ->