pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37907?usp=email )
Change subject: pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting ......................................................................
pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting
Otherwise the osmo-s1gw program stops if the UPF is not available at the time.
Change-Id: Ic17c1c7210ab4ae0ddc840a5ffd13b7cdda243c9 --- M src/pfcp_peer.erl 1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/07/37907/1
diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl index dc36c1f..ba8f8a9 100644 --- a/src/pfcp_peer.erl +++ b/src/pfcp_peer.erl @@ -155,12 +155,13 @@ ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), %% Tx PFCP Association Setup {ok, S1} = send_assoc_setup(S0), - {next_state, connecting, S1, - [{state_timeout, 2_000, assoc_setup_timeout}]}; + {keep_state, S1, [{state_timeout, 2_000, assoc_setup_timeout}]};
%% Handle Association Setup timeout -connecting(state_timeout, assoc_setup_timeout, _S) -> - {stop, {shutdown, assoc_setup_timeout}}; +connecting(state_timeout, assoc_setup_timeout, S) -> + % Re-start sending PFCP Association Setup above: + ?LOG_NOTICE("PFCP Association Setup timeout, UPF may be down, retrying..."), + {repeat_state, S};
%% Handle incoming PFCP PDU(s) connecting(info, {udp, Sock, _FromIp, _FromPort, Data},