fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37461?usp=email )
Change subject: sctp_server: do not let sctp_proxy:shutdown() crash the server
......................................................................
sctp_server: do not let sctp_proxy:shutdown() crash the server
Change-Id: Iaeedbc66cab21ec7274f864c8daf86c87f21e633
---
M src/sctp_server.erl
1 file changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/61/37461/1
diff --git a/src/sctp_server.erl b/src/sctp_server.erl
index d0484e6..8ea311f 100644
--- a/src/sctp_server.erl
+++ b/src/sctp_server.erl
@@ -197,7 +197,9 @@
client_del(Clients, Aid) ->
case dict:find(Aid, Clients) of
{ok, Client} ->
- sctp_proxy:shutdown(Client#client_state.pid),
+ %% the proxy process might be already dead, so we guard
+ %% against exceptions like noproc or {nodedown,Node}.
+ catch sctp_proxy:shutdown(Client#client_state.pid),
dict:erase(Aid, Clients);
error ->
Clients
@@ -228,7 +230,9 @@
{FromAddr, FromPort} = Client#client_state.addr_port,
?LOG_NOTICE("Terminating eNB connection (id=~p, ~p:~p)", [Aid, FromAddr,
FromPort]),
%% request to terminate an MME connection
- sctp_proxy:shutdown(Client#client_state.pid),
+ %% the proxy process might be already dead, so we guard
+ %% against exceptions like noproc or {nodedown,Node}.
+ catch sctp_proxy:shutdown(Client#client_state.pid),
%% gracefully close an eNB connection
gen_sctp:eof(Sock, #sctp_assoc_change{assoc_id = Aid}),
%% ... and so for the remaining clients
--
To view, visit
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37461?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Iaeedbc66cab21ec7274f864c8daf86c87f21e633
Gerrit-Change-Number: 37461
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange