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

[Sessiond] Credits gets suspended and immediately un-suspended on CCA-U with FUA #10609

Closed
joary opened this issue Dec 1, 2021 · 7 comments · Fixed by #10671
Closed

[Sessiond] Credits gets suspended and immediately un-suspended on CCA-U with FUA #10609

joary opened this issue Dec 1, 2021 · 7 comments · Fixed by #10671
Labels
type: bug Something isn't working

Comments

@joary
Copy link
Contributor

joary commented Dec 1, 2021

Prior to submitting an issue, check to see if one has already been created. If there is currently an open issue, add a thumbs-up emoji to identify that it is also affecting you.

Your Environment

  • Version: 1.5
  • Affected Component: AGW
  • Affected Subcomponent: Sessiond
  • Deployment Environment: Federeted FWA with Gx/Gy federation

Describe the Issue

When the subscriber quota ends the Gy will answer any CCR-U coming from magma with a CCA-U containing FUI and action configured to TERMINATE.

The behaviour seen is:

  1. On the first CCA-U the rules are dropped as expected.
  2. The next CCA-U the rules are dropped but are immediately reactivated
  3. The subsequent CCA-U the rule is dropped again as expected.
  4. The next CCA-U behavior on 2 reproduces

Follows the sessiond log for the suspention and imediatelly unsuspension seen in #2 and #4. (All IMSI values are the same)

image

Expected behavior

Magma should always drop the rules that are linked to the RG contained in the CCA-U with FUA TERMINATE

@joary joary added the type: bug Something isn't working label Dec 1, 2021
@joary
Copy link
Contributor Author

joary commented Dec 1, 2021

The probable root cause is the fact that magma suspends a given session (drop the rule) when the FUI is received and later un-suspends if a CCR-U is received and there's a suspended session.

The first CCA-U + 4012 FUA-TERMINATE magma gets will suspend the session: as seen here

The second CCA-U + 4012 FUA-TERMINATE will also suspend the session but it will later un-suspend it since there's a suspended session already, as seen here

The proposed workaround is to avoid the credit suspension here by changing the conditional to not be executed on FUA, for example:

if (valid_credit && !credit_update_resp.credit().is_final() && session->is_credit_suspended(credit_key)) {

cc @uri200, @themarwhal

@themarwhal
Copy link
Member

themarwhal commented Dec 1, 2021

Does the second CCA-U include any credit? I wonder why we pass the valid_credi check if the second one has the 4012 code.

@joary
Copy link
Contributor Author

joary commented Dec 1, 2021

Does the second CCA-U include any credit?

It does, my rationale:

valid_credit will only be false if the CCR-U has result PERMANENT_FAILURE. Though the CCR's that contains a FUI will also have a result code as TRANSIENT_FAILURE (4012) by Diameter definition.

@crbertoldo
Copy link

As per @joary's suggestion, adding && !credit_update_resp.credit().is_final() to this conditional, solves the issue:

Before:
if (valid_credit && session->is_credit_suspended(credit_key))

After:
if (valid_credit && !credit_update_resp.credit().is_final() && session->is_credit_suspended(credit_key))

@joary joary closed this as completed Dec 1, 2021
@uri200
Copy link
Contributor

uri200 commented Dec 2, 2021

that workaround will only work if the credit were final. If the credit was suspended for any other reason and it was not final the credit will never be unsuspended

@uri200 uri200 reopened this Dec 2, 2021
@uri200
Copy link
Contributor

uri200 commented Dec 2, 2021

The problem seems to be in fact this line

Being suspended and with no quota, should_activate should be fasle

@uri200
Copy link
Contributor

uri200 commented Dec 3, 2021

this pr may fix this issue
#10671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants