x2: exit if connection between eNB and gNB breaks
Before this commit, when the gNB crashes, the eNB keeps running. Same, if the eNB crashes, the gNB keeps running. In a far past when this happened, the other program (the one not crashing) was forced to exit. Then this behavior was changed, for some reason. But the code was not finished, so now we have a system in an inconsistent state. So either we accept that the connection between eNB and gNB can break, that is one of the programs crashes, and we clean the state of the program that keeps running. But this is a complex work and it will surely not survive very long, because someone will change something in the code later that will break this complex behavior. Or, simpler, we go back to initial behavior, which is: the program that did not crash does actually exit when the other crashes. This commit provides the second solution. It can easily be reverted whenever someone wants to implement the complex solution.
This commit is contained in:
@@ -116,9 +116,7 @@ void x2ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_associa
|
||||
/* some sanity check - to be refined at some point */
|
||||
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
|
||||
X2AP_ERROR("x2ap_enb_data_p not NULL and sctp state not SCTP_STATE_ESTABLISHED, what to do?\n");
|
||||
// Allow for a gracious exit when we kill first the gNB, then the eNB
|
||||
//abort();
|
||||
return;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
x2ap_enb_data_p->in_streams = sctp_new_association_resp->in_streams;
|
||||
|
||||
@@ -690,9 +690,11 @@ int x2ap_eNB_handle_x2_setup_failure(instance_t instance,
|
||||
// need a FSM to handle all cases
|
||||
if ((ie->value.choice.Cause.present == X2AP_Cause_PR_misc) &&
|
||||
(ie->value.choice.Cause.choice.misc == X2AP_CauseMisc_unspecified)) {
|
||||
X2AP_WARN("Received X2 setup failure for eNB ... eNB is not ready\n");
|
||||
X2AP_ERROR("Received X2 setup failure for eNB ... eNB is not ready\n");
|
||||
exit(1);
|
||||
} else {
|
||||
X2AP_ERROR("Received x2 setup failure for eNB... please check your parameters\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
x2ap_eNB_data->state = X2AP_ENB_STATE_WAITING;
|
||||
|
||||
Reference in New Issue
Block a user