Repository navigation
Conversation
e2_async_event_agent() resolved the subscription an aperiodic indication
answers with eq_ind_event_ric_req_id, which compares ric_req_id only.
ag->ind_event is keyed on the full ric_gen_id_t and can hold several entries
sharing a RIC Requestor ID: E2AP identifies a subscription by
{RequestorID, InstanceID}, and the O-RAN SC near-RT RIC's subscription manager
sets one fixed Requestor ID on every subscription it sends (ricRequestorId =
123, pkg/control/control.go).
First match wins, and cmp_ric_gen_id orders ran_func_id descending, so the
highest-numbered RAN function under that Requestor ID captures every aperiodic
indication. Its service model is then handed another model's ind_data, decodes
a foreign struct and aborts the RAN process.
Carry ric_gen_id_t end to end (sm_subs_data_t, wr_rc_sub_data_t, the async API,
free_aper_subs) and match on it with the existing eq_ind_event. Delete
eq_ind_event_ric_req_id, which has no correct use.
The aperiodic fd had the same defect. It was derived as -ric_req_id, so two
subscriptions sharing a Requestor ID collide on the bi_map key, and Requestor
ID 0 yields fd 0, which stop_ind_event() reads back as a real fd. Count down
from -1 instead.
An indication for a subscription that was just deleted is a race the RAN can
lose legitimately, so log and drop it instead of asserting.
It is dormant with FlexRIC's own near-RT RIC, which allocates a new Requestor
ID per subscription.
test/aperiodic_routing/ routes three subscriptions under one Requestor ID and
fails on the Requestor-ID-only matching.
Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Andrea Lacava <thecave003@gmail.com>
This was referenced Nov 27, 2026
This branch has not been deployed
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.
An aperiodic indication is routed to its subscription by the RIC Requestor ID alone, and a service model can be handed another model's indication data.
This continues #16, which was closed when its base branch
update-ubuntu-supportwas deleted after #31 merged. It is the same change rebased onto the currentdev: one commit, and no longer a copy of #31's commits.Why it happens
e2_async_event_agent()resolves the subscription an aperiodic indication answers witheq_ind_event_ric_req_id, which comparesric_req_idand ignoresric_inst_idandran_func_id. Butag->ind_eventis keyed on the fullric_gen_id_tand can hold several entries that share a Requestor ID: E2AP identifies a subscription by{RequestorID, InstanceID}.async_event_agent_api()did not even carry the RAN function, so the lookup could not have told them apart.First match wins, and
cmp_ric_gen_idordersran_func_iddescending, so the highest-numbered RAN function under a Requestor ID captures every aperiodic indication sent under it. Its service model is then given anind_dataof another model's type, decodes a foreign struct, and the RAN process aborts.Is this reachable?
It is dormant with FlexRIC's own near-RT RIC, which allocates a new Requestor ID per subscription (
ric->req_id++). The O-RAN SC near-RT RIC does not: its subscription manager sets one fixed Requestor ID on every subscription it sends (const ricRequestorId = 123inpkg/control/control.go), so every subscription on a node arrives under the same one. An xApp holding subscriptions on two RAN functions through that RIC is enough.The change
ric_gen_id_tis carried end to end instead ofric_req_id:sm_subs_data_t,wr_rc_sub_data_t,async_event_agent_api(),e2_async_event_agent()andfree_aper_subs.stop_ind_event()already had the whole ID and was discarding the rest.eq_ind_event.eq_ind_event_ric_req_idis deleted, since it has no correct use.-ric_req_id, so two subscriptions sharing a Requestor ID collide on thebi_mapkey, and Requestor ID 0 gives fd 0, whichstop_ind_event()reads back as a real fd. It now counts down from -1.assert(it != l && "Not found RIC Request ID")becomes a logged drop. An indication for a subscription that was just deleted is a race the RAN can lose legitimately. With the RAN function now at hand, the service model is resolved and handed the payload to free.This changes the signature of
async_event_agent_api()and of the subscription structs a service model'son_subscriptionfills, so out-of-tree service models and RAN-side callers need to pass the whole ID. In this tree that isrc_sm_agent.c, the RC emulator and the tests.Tests
test/aperiodic_routing/is new. It builds a stub agent holding three aperiodic subscriptions under Requestor ID 123 (RAN functions 3 and 142, and 142 again with a different instance ID) and checks each indication reaches the subscription with the whole ID.