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

rework context teardown on inactivity to include a proper cause #433

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

RoadRunnr
Copy link
Member

Rework the context inactivity handling to generate a delete GTP
message with a related cause (PDP address inactivity timer expire /
PDN connection inactivity timer expire).

Rework the context inactivity handling to generate a delete GTP
message with a related cause (PDP address inactivity timer expire /
PDN connection inactivity timer expire).
@RoadRunnr RoadRunnr requested a review from a team as a code owner September 14, 2021 09:29
Data = close_context(both, up_inactivity_timeout, State, Data0),
{next_state, shutdown, Data, [{reply, From, {ok, PCtx}}]};
State, #{pfcp := PCtx} = Data) ->
gen_statem:reply(From, {ok, PCtx}),

Choose a reason for hiding this comment

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

Is there a reason not to return a {reply, ...} value instead of manually replying? Is delete_context already returning something?

If this is the case, I'd prefer result values to calls/casts to be explicitly stated in the body of the appropriate handle_X function. It becomes difficult to follow the messages otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. gen_statem does not have a {reply, ...} return value, it would need a reply action instead
  2. delete_context/4 is returning {next_state,...} already. Passing {ok, PCtx} into that would need changes to delete_context and I want to keep the changes as local and minimal as possible.

Choose a reason for hiding this comment

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

  1. Thanks, I was forgetting that it's included in the list of actions.
  2. Yes, that is the behaviour I don't like :) I'd like to see a explicit action description in the body of the handle_ function. But I agree that this may not be the best case to start working on this.

Copy link

@javiermtorres javiermtorres left a comment

Choose a reason for hiding this comment

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

Please check the comment in gtp_context.erl. It is just a suggestion, since it'd impact lots of files, but please consider it for new code. Thanks!

@javiermtorres javiermtorres merged commit e41a4e4 into master Sep 14, 2021
@javiermtorres javiermtorres deleted the fix/idle-term-cause branch September 14, 2021 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants