stop waiting for the Gx terminate answer - #63
Merged
Conversation
next-nf
force-pushed
the
async-gate-rar-raa
branch
from
July 27, 2026 11:44
1174ee7 to
d8bd9b6
Compare
next-nf
force-pushed
the
async-terminate-step4
branch
from
July 27, 2026 11:44
7a44782 to
723e0b4
Compare
next-nf
force-pushed
the
async-gate-rar-raa
branch
from
July 27, 2026 12:16
d8bd9b6 to
ff6e8ff
Compare
next-nf
force-pushed
the
async-terminate-step4
branch
from
July 27, 2026 12:16
723e0b4 to
44d125a
Compare
next-nf
force-pushed
the
async-gate-rar-raa
branch
from
July 27, 2026 12:23
ff6e8ff to
793815b
Compare
next-nf
force-pushed
the
async-terminate-step4
branch
from
July 27, 2026 12:23
44d125a to
a826616
Compare
This file contains hidden or 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
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.
Completes rollout step 4 — "Terminate. Convert the deliberately-sync Gx terminate."
smf_gtp_gsn_session:close_context/7buildsReqOpts = #{now => Now, async => true}andthen overrides it for the Gx terminate alone with
ReqOpts#{async => false}. The Gyterminate further down the same function already uses
ReqOptsunmodified. This drops theoverride, making Gx consistent with the Gy call beside it.
Why it is safe
smf_aaa_gx:invoke/6'sCCR-Terminateclause isawait_response(send_request(Request, Opts), Session, Events, State, Opts)— and theordering is what matters.
smf_aaa_diameter_srv:send_request/4mints the Promise andspawns the process that performs the
diameter:callbefore returning, and that processis not linked to the context. So the CCR-T is already on its way by the time the handler
decides whether to wait, and it completes even if the context dies.
async => truechangesonly whether we block for the CCA-T, never whether the CCR-T is sent. The
#state{state = stopped}transition andinc_request_number/1also happen pre-send in thesame clause.
Why it is worth doing
The wait was unbounded:
smf_aaa_diameter_srv:await_response/1isawait_response(Promise, infinity). A PCRF that never answered the CCR-T hung the context inteardown permanently, unable to service anything — including the reentrant traffic this whole
initiative exists to keep flowing. The architecture doc flags exactly this: "the current
diameter sync
receives useinfinity— that becomes a design requirement, not an option."This is not a considered decision being reversed.
git log -S "async => false"dates theoverride to the 2020 "unify large parts of the GTP handlers" refactor, inherited from the
original erGW code.
What is lost
The two branches only logged. The
{ok, …}branch also threaded the post-CCAPCF/Sessiononward, but
smf_gtp_gsn_lib:close_context/4discards them moments later while finishing theteardown. So the real loss is the warning telling an operator the PCRF rejected the terminate
— accepted, since the session is going away and there is no action the PCEF takes on a failed
CCR-T. A
?LOG(debug, "Gx terminate issued")replaces the pair, and thecaseis kept so anon-
okreturn still falls back to the pre-call values.Testing — stated plainly
pgw_SUITEcannot discriminate this change, and I did not add a test pretendingotherwise. Its AAA handler is the synchronous
smf_aaa_staticmock, which never reachessmf_aaa_gx:invoke/6, so theasyncflag is inert there — the same infrastructure gaprecorded in #60. Any test I wrote would pass identically before and after.
What the existing suites do cover, and keeps passing:
pgw_SUITEassertsmeck:called(smf_aaa_pcf, ccr_terminate, ['_','_','_','_']), theFinal-Gxanswer is wiredfor
{gx, 'CCR-Terminate'}so every teardown in the suite runs this path, andggsn_SUITEand
saegw_s11_SUITEtear down through the same sharedclose_context/7.pgw_SUITE+ggsn_SUITE+saegw_s11_SUITE: 237 passed, 0 failures.Still blocking in teardown, out of scope:
smf_gtp_gsn_lib:close_context/3callssmf_pfcp_context:delete_session/2synchronously. Converting it needs the context to stayalive awaiting the reply, which conflicts with the teardown clauses that transition straight
to
shutdown— it belongs with the "~11 blockingmodify_sessionsites" work.With this, all five rollout steps are done. Stacked on #62; merge bottom-up:
#45 → #46 → #48 → #56 → #57 → #58 → #59 → #61 → #62 → this.