aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmsc/subscr_conn.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-11-22 14:33:12 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2017-11-27 15:40:01 +0100
commit6166f29412ef1dc3395dcee914ec98bd013663b4 (patch)
treeccbb38f1d76ae3126dd4ef967a4103b827f18f13 /src/libmsc/subscr_conn.c
parent2f108b09a953ee1285a8ebff948a3ad7bfa77780 (diff)
subscr_conn: introduce usage tokens for ref error tracking
When hunting a conn use count bug, it was very hard to figure out who's (not) using the conn. To ease tracking down this bug and future bugs, explicitly name what a conn is being reserved for, and track in a bit mask. Show in the DREF logs what uses and un-uses a conn. See the test expectation updates, which nicely show how that clarifies the state of the conn in the logs. On errors, log them, but don't fail hard: if one conn use/un-use fails, we don't want to crash the entire MSC before we have to. Change-Id: I259aa0eec41efebb4c8221275219433eafaa549b
Diffstat (limited to 'src/libmsc/subscr_conn.c')
-rw-r--r--src/libmsc/subscr_conn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libmsc/subscr_conn.c b/src/libmsc/subscr_conn.c
index 62b76195a..0fb4f5418 100644
--- a/src/libmsc/subscr_conn.c
+++ b/src/libmsc/subscr_conn.c
@@ -225,7 +225,7 @@ static void subscr_conn_fsm_cleanup(struct osmo_fsm_inst *fi,
return;
conn->conn_fsm = NULL;
msc_subscr_conn_close(conn, cause);
- msc_subscr_conn_put(conn);
+ msc_subscr_conn_put(conn, MSC_CONN_USE_FSM);
}
int subscr_conn_fsm_timeout(struct osmo_fsm_inst *fi)
@@ -320,7 +320,7 @@ int msc_create_conn_fsm(struct gsm_subscriber_connection *conn, const char *id)
* connection, then in _osmo_fsm_inst_term() the osmo_fsm_inst_free()
* that follows the cleanup() call would run into a double free. */
fi = osmo_fsm_inst_alloc(&subscr_conn_fsm, conn->network,
- msc_subscr_conn_get(conn),
+ msc_subscr_conn_get(conn, MSC_CONN_USE_FSM),
LOGL_DEBUG, id);
if (!fi) {