diff options
author | Erlang/OTP <[email protected]> | 2010-10-21 14:11:17 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-10-21 14:11:17 +0200 |
commit | c97c93401f18021907a79719bf35c2f937f57fcf (patch) | |
tree | a46e61db693e79b13633da1172987817882e7447 /lib/ssh/src/ssh_connection_manager.erl | |
parent | c219fb35d73ad393d983fd8b47a127d03cbc41c5 (diff) | |
parent | fddc1ed0341d13df8373509fa063d889fab8d219 (diff) | |
download | otp-c97c93401f18021907a79719bf35c2f937f57fcf.tar.gz otp-c97c93401f18021907a79719bf35c2f937f57fcf.tar.bz2 otp-c97c93401f18021907a79719bf35c2f937f57fcf.zip |
Merge branch 'nick/ssh/fix-process-leak/OTP-8807' into maint-r13
* nick/ssh/fix-process-leak/OTP-8807:
Fix race condition when terminating a connection.
fix process leak in ssh_system_sup (dynamicaly created childs where not cleaned up)
Diffstat (limited to 'lib/ssh/src/ssh_connection_manager.erl')
-rw-r--r-- | lib/ssh/src/ssh_connection_manager.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl index 9e55312e5f..6bf89224cf 100644 --- a/lib/ssh/src/ssh_connection_manager.erl +++ b/lib/ssh/src/ssh_connection_manager.erl @@ -560,13 +560,18 @@ handle_info({'EXIT', _, _}, State) -> %% The return value is ignored. %%-------------------------------------------------------------------- terminate(Reason, #state{connection_state = - #connection{requests = Requests}, + #connection{requests = Requests, + sub_system_supervisor = SubSysSup}, opts = Opts}) -> SSHOpts = proplists:get_value(ssh_opts, Opts), disconnect_fun(Reason, SSHOpts), (catch lists:foreach(fun({_, From}) -> gen_server:reply(From, {error, connection_closed}) end, Requests)), + Address = proplists:get_value(address, Opts), + Port = proplists:get_value(port, Opts), + SystemSup = ssh_system_sup:system_supervisor(Address, Port), + ssh_system_sup:stop_subsystem(SystemSup, SubSysSup), ok. %%-------------------------------------------------------------------- |