Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[agw] [stateless MME] Fix for failing stateless AGW integration tests #3462

Merged
merged 4 commits into from
Oct 30, 2020

Conversation

ssanadhya
Copy link
Collaborator

@ssanadhya ssanadhya commented Oct 27, 2020

Summary

Running the test test_attach_detach_with_<service>_restart.py for mme or mobilityd multiple times in a row was showing a failure while trying to detach an attached UE. This was happening as the s1ap_imsi_map table was getting cleared from Redis every time the MME process exited, leading to the error:

Received S1AP UPLINK_NAS_TRANSPORT No UE is attached to this mme_ue_s1ap_id

This error only showed up for the second run of the test case even though each test case attaches/detaches two UEs. This is because the first UE detaches with detach-type "Normal detach", which triggered procedures to re-insert the entry in s1ap_imsi_map. Only for the second UE, which detached with detach-type "Switch-off" the map stays empty forever.

This change fixes this issue by

Test Plan

  • S1AP integration tests with all stateless test cases included
  • Run test_attach_detach_with_mme_restart.py multiple times and make sure the above error does not occur
  • Integration test with CUPS SPGW will be done in Jenkins CI

@ssanadhya ssanadhya requested a review from ulaskozat as a code owner October 27, 2020 05:52
@ssanadhya ssanadhya linked an issue Oct 27, 2020 that may be closed by this pull request
@ssanadhya ssanadhya changed the title {WIP} Sl test fix {WIP} [agw] [stateless MME] Fix for failing stateless AGW integration tests Oct 27, 2020
Comment on lines 165 to 168
hashtable_uint64_ts_destroy(s1ap_imsi_map_->mme_ue_id_imsi_htbl);

free_wrapper((void**) &s1ap_imsi_map_);

if (persist_state_enabled) {
std::vector<std::string> keys_to_del;
keys_to_del.emplace_back(S1AP_IMSI_MAP_TABLE_NAME);
redis_client->clear_keys(keys_to_del);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is S1apStateManager::clear_s1ap_imsi_map() called only during the service exit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is only called at service exit, to clear all the memory allocated to the hashtable.

Copy link
Contributor

@ulaskozat ulaskozat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ssanadhya ssanadhya changed the title {WIP} [agw] [stateless MME] Fix for failing stateless AGW integration tests [agw] [stateless MME] Fix for failing stateless AGW integration tests Oct 28, 2020
@ssanadhya ssanadhya changed the title [agw] [stateless MME] Fix for failing stateless AGW integration tests {WIP}[agw] [stateless MME] Fix for failing stateless AGW integration tests Oct 28, 2020
@ssanadhya ssanadhya added the component: agw Access gateway-related issue label Oct 28, 2020
Signed-off-by: Shruti Sanadhya <ssanadhya@fb.com>
Signed-off-by: Shruti Sanadhya <ssanadhya@fb.com>
Signed-off-by: Shruti Sanadhya <ssanadhya@fb.com>
Signed-off-by: Shruti Sanadhya <ssanadhya@fb.com>
@ssanadhya ssanadhya changed the title {WIP}[agw] [stateless MME] Fix for failing stateless AGW integration tests [agw] [stateless MME] Fix for failing stateless AGW integration tests Oct 29, 2020
@ssanadhya ssanadhya merged commit 4c40b63 into magma:master Oct 30, 2020
@ssanadhya
Copy link
Collaborator Author

Merging despite Jenkins CI failures as those failures are unrelated to this change.

@ssanadhya ssanadhya deleted the sl_test_fix branch October 30, 2020 03:47
@ssanadhya ssanadhya added the apply-v1.3 Needs to be applied to v1.3 release branch as well label Nov 20, 2020
ssanadhya added a commit that referenced this pull request Nov 20, 2020
…#3462)

* Stop clearing s1ap_imsi_map from Redis
* Re-adding stateless tests in sanity suite
* Remove sleep from sctpd_post block in config_stateless_agw script
* Commenting out data tests for stateless

Signed-off-by: Shruti Sanadhya <ssanadhya@fb.com>
@ssanadhya ssanadhya added the backported-v1.3 Has been backported to v1.3 release branch label Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apply-v1.3 Needs to be applied to v1.3 release branch as well backported-v1.3 Has been backported to v1.3 release branch component: agw Access gateway-related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky stateless test case with Mobilityd restart
3 participants