pespin has submitted this change. ( 
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(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




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},

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37907?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Ic17c1c7210ab4ae0ddc840a5ffd13b7cdda243c9
Gerrit-Change-Number: 37907
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to