-
Notifications
You must be signed in to change notification settings - Fork 598
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
[SessionD] Clean up LocalEnforcer #2483
Merged
themarwhal
merged 2 commits into
magma:master
from
themarwhal:cleanup-force-timeout-termination
Sep 9, 2020
Merged
[SessionD] Clean up LocalEnforcer #2483
themarwhal
merged 2 commits into
magma:master
from
themarwhal:cleanup-force-timeout-termination
Sep 9, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
from
August 26, 2020 16:10
e3b3c07
to
742ab66
Compare
themarwhal
changed the title
[SessionD] Cleanup force timeout termination
[SessionD] Cleanup Session termination logic
Aug 26, 2020
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
2 times, most recently
from
August 28, 2020 13:18
00398d0
to
e1b0d60
Compare
themarwhal
changed the title
[SessionD] Cleanup Session termination logic
[SessionD] Clean up LocalEnforcer
Aug 28, 2020
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
2 times, most recently
from
August 31, 2020 08:47
aa27e26
to
1d67e2f
Compare
uri200
reviewed
Sep 1, 2020
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
2 times, most recently
from
September 2, 2020 14:50
337f41d
to
642135c
Compare
themarwhal
requested review from
andreilee,
ardzoht,
karthiksubraveti,
koolzz,
pshelar,
Scott8440 and
xjtian
as code owners
September 2, 2020 14:53
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
from
September 8, 2020 15:01
642135c
to
33c5684
Compare
uri200
approved these changes
Sep 8, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Signed-off-by: Marie Bremner <marwhal@fb.com>
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
2 times, most recently
from
September 9, 2020 11:23
284684b
to
8c38df6
Compare
…e not LocalEnforcer + use const values for IMSI and SessionID Signed-off-by: Marie Bremner <marwhal@fb.com> Use SessionState's get_monitor instead of LocalEnforcer's get_monitor_credit in testing Signed-off-by: Marie Bremner <marwhal@fb.com>
themarwhal
force-pushed
the
cleanup-force-timeout-termination
branch
from
September 9, 2020 11:49
8c38df6
to
a493e2b
Compare
ulaskozat
pushed a commit
to ulaskozat/magma
that referenced
this pull request
Sep 16, 2020
* Clean up session force timeout logic Signed-off-by: Marie Bremner <marwhal@fb.com> * Migrate test_local_enforcer to use get_charging_credit in SessionState not LocalEnforcer + use const values for IMSI and SessionID Signed-off-by: Marie Bremner <marwhal@fb.com> Use SessionState's get_monitor instead of LocalEnforcer's get_monitor_credit in testing Signed-off-by: Marie Bremner <marwhal@fb.com>
rdefosse
pushed a commit
to rdefosse/magma
that referenced
this pull request
Oct 9, 2020
* Clean up session force timeout logic Signed-off-by: Marie Bremner <marwhal@fb.com> * Migrate test_local_enforcer to use get_charging_credit in SessionState not LocalEnforcer + use const values for IMSI and SessionID Signed-off-by: Marie Bremner <marwhal@fb.com> Use SessionState's get_monitor instead of LocalEnforcer's get_monitor_credit in testing Signed-off-by: Marie Bremner <marwhal@fb.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
4 things are covered in this PR:
This change was brought up because I was noticing this log all the time when observing SessionD logs.
[IMSI] Forcefully terminating session since it did not receive usage from pipelined in time
. I initially thought there was a bug somewhere that was causing sessions to be terminated forcefully all the time. (As opposed to terminating itself after PipelineD's enforcement stats were cleared.) But it turns out the logs were inaccurate.This log comes from
SessionState
'scomplete_termination
, which is used in both force termination and regular termination. So the fix here is to update the logs to reflect the behavior.Finally, while I was looking at the function, I noticed that
LocalEnforcer
passes theSessionReporter
into the function, which is a bit of an anti-pattern since we do all reporting from eitherLocalSessionManagerHandler
orLocalEnforcer
. So I moved out the logic toLocalEnforcer
.update_criteria
->uc
There are to main changes. Many of the LocalEnforcer functions had 'session_map' as a parameter when it is not used at all. (This is probably left over from legacy code). Second,
PipelineDClient
always returns true as a result of making an asynchronous call, so there is no value in casing on its return value.Remove
LocalEnforcer
'sget_charging_credit
andget_monitor_credit
since they are only used for testing. The functions also just have a questionable way to go from IMSI, bucket -> value. (Sessions are unique by IMSI+SessionID, not just IMSI). Instead,assert_charging_credit
andassert_monitor_credit
are used intest_local_enforcer.cpp
. Additionally, instead of having hardcoded imsi/sessionID test values, migrate to a model where we use a predefined set of values.Test Plan
unit tests, s1ap test (ran it locally it passed)
Additional Information