This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/25646 )
Change subject: Delay abis reconnect while bts is shutting down
......................................................................
Delay abis reconnect while bts is shutting down
Avoid re-connecting to a new BSC while BTS is in shutting down. All the
FSMs are complex enough to even try to re-start when stopping has not
yet finished...
Change-Id: I1727828a16f4ec8043b00cc6b2e02a4c35f71377
---
M include/osmo-bts/bts_shutdown_fsm.h
M src/common/abis.c
M src/common/bts_shutdown_fsm.c
3 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/25646/1
diff --git a/include/osmo-bts/bts_shutdown_fsm.h b/include/osmo-bts/bts_shutdown_fsm.h
index 1e74ac6..76ac6ca 100644
--- a/include/osmo-bts/bts_shutdown_fsm.h
+++ b/include/osmo-bts/bts_shutdown_fsm.h
@@ -39,3 +39,6 @@
};
extern struct osmo_fsm bts_shutdown_fsm;
+
+struct gsm_bts;
+bool bts_shutdown_in_progress(const struct gsm_bts *bts);
diff --git a/src/common/abis.c b/src/common/abis.c
index 11111fa..f1fb10c 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -53,6 +53,7 @@
#include <osmo-bts/abis_osmo.h>
#include <osmo-bts/bts_model.h>
#include <osmo-bts/bts_trx.h>
+#include <osmo-bts/bts_shutdown_fsm.h>
static struct gsm_bts *g_bts;
@@ -137,6 +138,12 @@
struct abis_link_fsm_priv *priv = fi->priv;
struct gsm_bts *bts = priv->bts;
+ if (bts_shutdown_in_progress(bts)) {
+ LOGPFSML(fi, LOGL_NOTICE, "BTS is shutting down, delaying A-bis connection establishment to BSC\n");
+ osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_WAIT_RECONNECT, OML_RETRY_TIMER, 0);
+ return;
+ }
+
if (pick_next_bsc(fi) < 0) {
LOGPFSML(fi, LOGL_FATAL, "No BSC available, A-bis connection establishment failed\n");
osmo_fsm_inst_state_chg(fi, ABIS_LINK_ST_FAILED, 0, 0);
diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c
index 85d2d83..600407a 100644
--- a/src/common/bts_shutdown_fsm.c
+++ b/src/common/bts_shutdown_fsm.c
@@ -237,10 +237,16 @@
OSMO_ASSERT(osmo_fsm_register(&bts_shutdown_fsm) == 0);
}
+bool bts_shutdown_in_progress(const struct gsm_bts *bts)
+{
+ struct osmo_fsm_inst *fi = bts->shutdown_fi;
+ return fi->state != BTS_SHUTDOWN_ST_NONE;
+}
+
void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc)
{
struct osmo_fsm_inst *fi = bts->shutdown_fi;
- if (fi->state != BTS_SHUTDOWN_ST_NONE) {
+ if (bts_shutdown_in_progress(bts)) {
LOGPFSML(fi, LOGL_NOTICE, "BTS is already being shutdown.\n");
if (exit_proc)
bts->shutdown_fi_exit_proc = true;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25646
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1727828a16f4ec8043b00cc6b2e02a4c35f71377
Gerrit-Change-Number: 25646
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210929/4da6e914/attachment.htm>