pespin submitted this change.
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(-)
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 change 37907. To unsubscribe, or for help writing mail filters, visit settings.