The Discovery Cache That Outlives Your SMF Failover
An AMF that caches SMF discovery results for longer than the NRF needs to declare an SMF dead keeps sending PDU session requests to an instance that is no longer there. Code review won't flag it, because each value is valid on its own. The validity period lives in the NRF discovery policy, the heartbeat timer lives in each NF profile, and the two usually sit in different repositories owned by different teams. Stateless SMF pods and an external session store don't help if the consumer never asks again where to send traffic.
Why the diff looks clean
The 3GPP service-based architecture specifications give the NRF two independent clocks. heartBeatTimer, in seconds, sets how often an NF must refresh its profile before the NRF marks it SUSPENDED. validityPeriod in the discovery SearchResult tells the consumer how long it may reuse that answer without asking again. Nothing ties the two together, and no schema validator rejects a validity period far longer than the heartbeat, so a lab value chosen to keep NRF load down during soak tests reaches production unchanged. The subscription to NF status notifications, which was supposed to cover the gap, often turns out to be an optional toggle in the consumer's Helm values that nobody enabled. The failure is quiet: the NRF correctly suspends the SMF and its dashboards stay green, while the AMF keeps selecting the dead instance until its cache expires, and every timeout costs a session attempt.
The missing set identifier
The second half of the same mistake is an SMF profile without nfSetIdList: even a consumer that notices the failure has no declared peer group to reselect from, so it falls back to a fresh discovery under load, just when the NRF is busiest.
A check you can run against the NRF today
Ask the NRF the same question your AMF asks, then compare the two clocks yourself. From a pod that can reach the NRF service interface, run curl 'http://nrf.core.svc:8000/nnrf-disc/v1/nf-instances?target-nf-type=SMF&requester-nf-type=AMF' | jq '{validity:.validityPeriod, nfs: [.nfInstances[] | {id:.nfInstanceId, set:.nfSetIdList, hb:.heartBeatTimer}]}'. Add whatever option your curl build needs for cleartext HTTP/2, or point it at the TLS endpoint. If hb comes back null, that instance is running on the NRF default, which you should look up rather than assume. A null set fails the reselection check. A validity larger than the heartbeat multiplied by the number of missed beats your NRF tolerates is the bug itself. Put the same expression in CI against a staging NRF loaded with production values and fail the pipeline when that inequality breaks, because CI is the only place where both repositories meet.
Choosing which clock gives way
The decision rule is simple: consumer cache validity must not exceed the NRF suspension window, meaning the heartbeat interval times the number of tolerated misses. If NRF capacity won't let you shorten validity, the status notification subscription becomes mandatory, and you prove it works by killing an SMF in staging and timing how long the AMF keeps selecting it. Shortening validity has a real cost: on a large AMF pool, matching validity to the suspension window can raise discovery traffic by roughly an order of magnitude (estimate). The notification path can also fail on its own, for example when the callback URI resolves to a pod address that changed during a rolling upgrade. You are choosing between more NRF load and trusting a callback, and only a failure test can show which one you can afford.
Technical FAQ: Doesn't indirect communication through an SCP make this go away?
No, it moves the problem. The SCP caches discovery results too, so the same inequality applies to its configuration, and with delegated discovery the AMF has no local cache to inspect. Run the check against the view the SCP gets from the NRF, and run the kill test through the SCP path.