summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Nilsson <hans@erlang.org>2021-02-22 09:58:28 +0100
committerHans Nilsson <hans@erlang.org>2021-02-22 09:58:28 +0100
commitd7d3537c0606a22ad38e2641ac51bc7cdee0b383 (patch)
tree980d6365bc0a43a04c266f2e795161ee210f169d
parent705ff63f3dcde47258449dc86ef96847d410dfd1 (diff)
parentb6974c0f4cf19910c100cc50dfab74adeddf6f25 (diff)
downloaderlang-d7d3537c0606a22ad38e2641ac51bc7cdee0b383.tar.gz
Merge branch 'hans/ssh/ssh_controller_timeout/ERIERL-581/OTP-17173' into maint
* hans/ssh/ssh_controller_timeout/ERIERL-581/OTP-17173: ssh: Fix crash of controller
-rw-r--r--lib/ssh/src/ssh_controller.erl16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/ssh/src/ssh_controller.erl b/lib/ssh/src/ssh_controller.erl
index 4b8f5a7e8e..d8fbc8d0f2 100644
--- a/lib/ssh/src/ssh_controller.erl
+++ b/lib/ssh/src/ssh_controller.erl
@@ -104,11 +104,17 @@ handle_call({start_system_subsystem, Sup, Address, Port, Profile, Options, Child
handle_call({stop_system,SysSup}, _From, D) ->
- case supervisor:which_children(SysSup) of
- [] ->
- ssh_system_sup:stop_system(D#data.role, SysSup);
- _X ->
- ok
+ try
+ case supervisor:which_children(SysSup) of
+ [] ->
+ ssh_system_sup:stop_system(D#data.role, SysSup);
+ _X ->
+ ok
+ end
+ catch
+ _:_ ->
+ %% Already stopped (?)
+ skip
end,
{reply, ok, D}.