neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/31273 )
Change subject: fix some PFCP peer,session error handling paths
......................................................................
fix some PFCP peer,session error handling paths
Fix various failures to return and/or discard a session on PFCP message
errors.
Change-Id: I12650037c7c74d98e1f33e0379cf91edcbd02d1a
---
M src/osmo-upf/up_peer.c
M src/osmo-upf/up_session.c
2 files changed, 17 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/src/osmo-upf/up_peer.c b/src/osmo-upf/up_peer.c
index ec50674..8499632 100644
--- a/src/osmo-upf/up_peer.c
+++ b/src/osmo-upf/up_peer.c
@@ -327,6 +327,8 @@
.cause = cause,
};
osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, resp);
+ if (session)
+ up_session_discard(session);
}
static void up_peer_not_associated_action(struct osmo_fsm_inst *fi, uint32_t event, void *data)
diff --git a/src/osmo-upf/up_session.c b/src/osmo-upf/up_session.c
index 0c2f103..59d45c0 100644
--- a/src/osmo-upf/up_session.c
+++ b/src/osmo-upf/up_session.c
@@ -631,14 +631,20 @@
resp->up_f_seid_present = true;
rc = osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, tx);
- if (rc)
+ if (rc) {
+ /* sending ACK failed, discard session. It might seem like a good idea to keep the session around,
+ * because the creation succeeded, only the ACK failed. But in the greater scheme of things, if we
+ * cannot ACK to the PFCP peer, all is lost. Rather not keep stale sessions around. */
up_session_fsm_state_chg(UP_SESSION_ST_WAIT_USE_COUNT);
+ return;
+ }
up_session_fsm_state_chg(UP_SESSION_ST_ESTABLISHED);
return;
nack_response:
resp->created_pdr_count = 0;
osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, tx);
+ /* No matter if sending the NACK succeeded or not, discard the session. */
up_session_fsm_state_chg(UP_SESSION_ST_WAIT_USE_COUNT);
}
@@ -719,8 +725,13 @@
goto nack_response;
/* Success, send ACK */
- if (osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, tx))
+ if (osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, tx)) {
+ /* sending ACK failed, discard session. It might seem like a good idea to keep the session around,
+ * because the modification succeeded, only the ACK failed. But in the greater scheme of things, if we
+ * cannot ACK to the PFCP peer, all is lost. Rather not keep stale sessions around. */
up_session_fsm_state_chg(UP_SESSION_ST_WAIT_USE_COUNT);
+ return;
+ }
LOGPFSML(fi, LOGL_NOTICE, "Session modified: %s\n", up_session_gtp_status(session));
return;
@@ -728,6 +739,7 @@
nack_response:
resp->created_pdr_count = 0;
osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, tx);
+ /* No matter if sending the NACK succeeded or not, discard the session. */
up_session_fsm_state_chg(UP_SESSION_ST_WAIT_USE_COUNT);
}
@@ -742,6 +754,7 @@
.cause = OSMO_PFCP_CAUSE_REQUEST_ACCEPTED
};
osmo_pfcp_endpoint_tx(peer->up_endpoint->pfcp_ep, tx);
+ /* No matter if sending the deletion ACK succeeded or not, discard the session. */
up_session_fsm_state_chg(UP_SESSION_ST_WAIT_USE_COUNT);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/31273
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I12650037c7c74d98e1f33e0379cf91edcbd02d1a
Gerrit-Change-Number: 31273
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: neels.
Hello osmith, Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/31266
to look at the new patch set (#3).
Change subject: add contrib/talloc_count.sh
......................................................................
add contrib/talloc_count.sh
When a user reports a memory leak with a talloc report, this script is
useful to quickly get a handle of what is being leaked. The alternative
is eyeballing the talloc report for a very long time.
Change-Id: I5b3242dd6e0649925ac6abfd1e96625c682b8934
---
A contrib/talloc_count.sh
1 file changed, 52 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/31266/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/31266
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I5b3242dd6e0649925ac6abfd1e96625c682b8934
Gerrit-Change-Number: 31266
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newpatchset
arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31029 )
Change subject: osmo-bsc: Fix 'apply-config-file' CTRL command
......................................................................
Patch Set 3:
(1 comment)
File src/osmo-bsc/bsc_ctrl.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/31029/comment/9d87c63b_c63f09f7
PS2, Line 89: cmd->reply = talloc_asprintf(cmd, "Errors in neighbor configuration");
> Ah I misread the function being called, I thought the function validating the whole BTS config was b […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31029
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I24ae8cd7e5e0d15eab9fd04b1858072bf0bad36a
Gerrit-Change-Number: 31029
Gerrit-PatchSet: 3
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 10 Feb 2023 19:58:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment