Skip to content

Commit

Permalink
Allow the supervisor tree to restart a failed release
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
  • Loading branch information
Gregory Haskins committed Apr 19, 2011
1 parent 899b265 commit 6f2ab65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agent/app/src/main/erlang/edist_agent_sup.erl
Expand Up @@ -26,7 +26,7 @@ delete_child(Id) ->
ok = supervisor:delete_child(?MODULE, Id).

init([Path]) ->
{ok,{{one_for_all,0,1},
{ok,{{one_for_one,1,60},
[
{'edist-agent',
{edist_agent,start_link,[]},
Expand Down
10 changes: 5 additions & 5 deletions agent/app/src/main/erlang/release_fsm.erl
Expand Up @@ -49,7 +49,7 @@ connecting({controller, connected, Session}, State) ->

binding({release_stopped, _Data}, State) ->
gen_fsm:cancel_timer(State#state.tmoref),
{stop, normal, State};
{stop, "Subordinate death", State};
binding({timeout, _, bind}, State) ->
case bind(State) of
true ->
Expand All @@ -69,7 +69,7 @@ binding({controller, disconnected}, State) ->

disconnected_binding({release_stopped, _Data}, State) ->
gen_fsm:cancel_timer(State#state.tmoref),
{stop, normal, State};
{stop, "Subordinate death", State};
disconnected_binding({timeout, _, bind}, State) ->
case bind(State) of
true ->
Expand All @@ -93,7 +93,7 @@ disconnected_binding({controller, connected, Session}, State) ->

upgrading_binding({release_stopped, _Data}, State) ->
gen_fsm:cancel_timer(State#state.tmoref),
{stop, normal, State};
{stop, "Subordinate death", State};
upgrading_binding({timeout, _, bind}, State) ->
case bind(State) of
true ->
Expand All @@ -106,7 +106,7 @@ upgrading_binding({controller, disconnected}, State) ->
State#state{session=undefined, subid=undefined}}.

running({release_stopped, _Data}, State) ->
{stop, normal, State};
{stop, "Subordinate death", State};
running({hotupdate, Vsn}, State) ->
if
Vsn =/= State#state.vsn ->
Expand All @@ -118,7 +118,7 @@ running({controller, disconnected}, State) ->
{next_state, reconnecting, State#state{session=undefined, subid=undefined}}.

reconnecting({release_stopped, _Data}, State) ->
{stop, normal, State};
{stop, "Subordinate death", State};
reconnecting({controller, connected, Session}, State) ->
{ok, RelProps, SubId} =
controller_api:subscribe_release(Session, State#state.rel),
Expand Down

0 comments on commit 6f2ab65

Please sign in to comment.