Skip to content

Answer a repeated subscription with the one the RAN holds - #147

Draft
Thecave3 wants to merge 1 commit into
fix/93-121-vanished-dapp-and-reconnectfrom
fix/97-repeat-subscription
Draft

Thecave3 wants to merge 1 commit into
fix/93-121-vanished-dapp-and-reconnectfrom
fix/97-repeat-subscription

Conversation

@Thecave3

@Thecave3 Thecave3 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

A libe3 RAN answers a repeated subscription (same dApp, same RAN function) with the existing subscription id, as it always did, and kept the lists and periodicity of the first request. But the response echoed the lists and periodicity of the repeat, so a dApp that subscribed again to change its periodicity read the new value and kept the old rate (#97).

What a RAN does now

  • A repeat is answered with the same id and with the telemetry and control lists the RAN holds, not those of the repeat.
  • A repeat the RAN refuses (an identifier the function does not advertise) leaves the subscription as it was.
  • A repeat after subscriptionTime ran out still renews the subscription in place.
  • To change a subscription a dApp deletes it and subscribes again. That is the only form that behaves alike on libe3, Aerial's agent and OCUDU, and the interop page now says so.

Nothing changes on the wire, in the C API or in libe3py. The interop page also corrects what it said about Aerial: its agent has no check for an existing subscription and adds one for every request. Only the dApp manager of the Aerial sample apps stops at one, before it sends anything. OCUDU adds one per repeat until a per-dApp limit, then refuses with resourceExhausted; the page now calls that a defect.

What a user sees

Before After
dApp subscribes twice, second request has other lists positive, same id, response lists the second request's lists, RAN holds the first's positive, same id, response lists what the RAN holds
dApp subscribes twice, second request has another periodicity positive; the response shows the new value, the old one stays positive; the old one stays and is the one the RAN holds
second request names an identifier the function lacks negative, subscription unchanged the same
dApp that registered again (#146) subscribes fresh subscription the same: it has a new id, so it is not a repeat

What is not done

  • Updating a subscription in place. A dApp that wants other lists or another periodicity deletes and subscribes again, which gives it a new id and a gap in indications.
  • A guard in the libe3 dApp against subscribing twice. Against OCUDU a repeat uses up one of the dApp's subscriptions until resourceExhausted.

Commits

  1. core: answer a repeated subscription with the one the RAN holds, with its test, the specification and guide changes, the interop page changes and the version bump.

Notes for review

Type of change

  • Bug fix
  • New feature / enhancement
  • New Service Model
  • Refactor (no behavior change)
  • Documentation
  • Test / CI / packaging
  • Other (explain):

Linked issue

Closes #97

Twin-repo coordination

  • This PR does not change the E3 wire protocol or public ABI, OR a paired PR exists in each affected twin repo (link below).
  • This PR does not change the wire format or a behavior a peer (OAI, Aerial, OCUDU) can observe, OR I added a row to the change ledger in docs/interop.md.

Paired PR(s): none needed. OAI's E3 agent does not need a rebuild for this change.

Checks run locally

In an Ubuntu 24.04 container with ./build_libe3:

  • Each commit of the stack up to this one, built and tested on its own in Release: all tests pass.
  • This PR, -r -t (Release) and -g -t (Debug): all tests pass.
  • --docs-strict: no warning.
  • The branch is linear, git log --merges origin/main..HEAD is empty.
  • Not run: the MPMC benchmark (this PR does not touch the queue), the SWIG build and the other CI workflows.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

CI report — ff4feb9 — ✅ all checks passed

Workflow Result Time Run
CI ✅ success 21m21s #10
Docs ✅ success 0m25s #84
CI

✅ posix/ipc

  • dApp exit: 0
  • Indications received: 7

✅ posix/tcp

  • dApp exit: 0
  • Indications received: 7

✅ zmq/ipc

  • dApp exit: 0
  • Indications received: 7

✅ zmq/tcp

  • dApp exit: 0
  • Indications received: 7

zmq/ipc

  • ✅ 1 RAN - 1 dApp: indications=5
    • dapp peer=t11 ran=ran-solo sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
  • ✅ 1 RAN - 2 dApps: dApp#1 ind=5 sub=1, dApp#2 ind=6 sub=2, RAN saw 2 dApps
    • dapp1 peer=t12 ran=ran-shared sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp2 peer=t12 ran=ran-shared sub=2 indications=6 seq=[0..5] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:6 2-5:0 6-10:0 >10:0]
  • ✅ 2 RANs - 1 dApp: from ran-a ind=5, from ran-b ind=5
    • dapp peer=t2a ran=ran-a sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp peer=t2b ran=ran-b sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]

zmq/tcp

  • ✅ 1 RAN - 1 dApp: indications=5
    • dapp peer=default ran=ran-solo sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.4 max=1 @seq=3) hist[<=1:5 2-5:0 6-10:0 >10:0]
  • ✅ 1 RAN - 2 dApps: dApp#1 ind=5 sub=1, dApp#2 ind=6 sub=2, RAN saw 2 dApps
    • dapp1 peer=default ran=ran-shared sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0.4 max=1 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp2 peer=default ran=ran-shared sub=2 indications=6 seq=[0..5] dropped=0 (0%) age_ms(avg=0.5 max=1 @seq=0) hist[<=1:6 2-5:0 6-10:0 >10:0]
  • ✅ 2 RANs - 1 dApp: from ran-a ind=5, from ran-b ind=5
    • dapp peer=default ran=ran-a sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]
    • dapp peer=off100 ran=ran-b sub=1 indications=5 seq=[0..4] dropped=0 (0%) age_ms(avg=0 max=0 @seq=0) hist[<=1:5 2-5:0 6-10:0 >10:0]

Full-loop latency

Full-loop latency benchmark (N=1076 after 50 warmup)

All values in microseconds (μs). Link: zmq, transport: ipc, encoding: ASN.1 APER.

# Description Tags mean p50 p99 max
1 Collect indication data RECORD_BEGIN to ENCODE_E3SM_BEGIN 0.13 0.12 0.30 0.54
2 Create & encode indication ENCODE_E3SM_BEGIN to ENCODE_E3SM_DONE 0.98 0.94 1.65 4.83
3 Encode E3AP (indication) EMIT_ENTER to ENQUEUE, then DEQUEUE to ENCODE_E3AP_DONE 2.58 2.38 5.43 20.28
4 Queuing (indication) ENQUEUE to DEQUEUE 5.95 7.04 13.78 24.94
5 Delivery (indication) ENCODE_E3AP_DONE to SEND_DONE 0.38 0.27 1.41 21.85
6 E3 wire (RAN -> dApp) SEND_DONE to RECV 41.95 41.21 61.35 69.55
7 Decode E3AP (indication) RECV to DECODE_E3AP_DONE 1.53 1.51 5.65 24.18
8 libe3 dispatch (indication) DECODE_E3AP_DONE to DELIVER_BEGIN 0.13 0.12 0.23 0.41
9 Decode indication DELIVER_BEGIN to DECODE_E3SM_DONE 0.51 0.53 0.71 0.93
10 Process data DECODE_E3SM_DONE to ENCODE_E3SM_BEGIN 0.04 0.04 0.05 0.10
11 Create & encode control ENCODE_E3SM_BEGIN to ENCODE_E3SM_DONE 0.35 0.35 0.49 0.75
12 Encode E3AP (control) EMIT_ENTER to ENQUEUE, then DEQUEUE to ENCODE_E3AP_DONE 3.31 3.23 5.61 19.97
13 Queuing (control) ENQUEUE to DEQUEUE 12.34 11.68 19.32 225.60
14 Delivery (control) ENCODE_E3AP_DONE to SEND_DONE 6.18 5.95 18.25 23.43
15 E3 wire (dApp -> RAN) SEND_DONE to RECV 42.96 42.12 61.77 126.52
16 Decode E3AP (control) RECV to DECODE_E3AP_DONE 2.74 2.65 4.95 19.30
17 libe3 dispatch (control) DECODE_E3AP_DONE to DECODE_E3SM_BEGIN 0.76 0.71 1.08 28.69
18 Decode & handle control DECODE_E3SM_BEGIN to DECODE_E3SM_DONE 0.34 0.33 0.46 1.31
Total Total round-trip 123.80 121.80 152.84 357.39

ubuntu-latest, Release build, ZMQ + IPC, ASN.1 APER.

These numbers are measured inside a GitHub Actions container and should be treated as an upper bound on E3AP's and the library's own latency, not a representative deployment measurement.

Docs

Doxygen warnings

0 warning(s) in the files this pull request changes, which fail the check; 119 more elsewhere, which do not. The full list is in the job log and the doxygen-warnings artifact of the Docs workflow.

Gaps in files this pull request does not change, by file:

Warnings File
37 include/libe3/sm_interface.hpp
17 include/libe3/logger.hpp
17 swig/libe3_swig.hpp
17 swig/e3_dapp_session.hpp
9 include/libe3/dapp_subscription_state.hpp
7 include/libe3/lockfree_queue.hpp
6 include/libe3/mpmc_queue.hpp
1 include/libe3/error_codes.h
1 include/libe3/libe3.hpp
1 src/connector/zmq_connector.hpp

Ready to merge (fast-forward only)

A maintainer can land the reviewed commits with:

git fetch origin
git checkout main && git merge --ff-only ff4feb99e167fcb1bd0ecfa93da72ce7d86e3bfa && git push origin main

Head: ff4feb99e167fcb1bd0ecfa93da72ce7d86e3bfa (branch fix/97-repeat-subscription). If --ff-only fails as non-fast-forward, the branch must be rebased on the latest main.

One comment per PR, rewritten in place once every workflow for ff4feb9 finished.

@Thecave3
Thecave3 force-pushed the fix/97-repeat-subscription branch from d2c8c0e to 3ca4c67 Compare November 7, 2026 15:09
@Thecave3
Thecave3 force-pushed the fix/93-121-vanished-dapp-and-reconnect branch from b67557c to bfcd006 Compare November 10, 2026 12:41
@Thecave3
Thecave3 force-pushed the fix/97-repeat-subscription branch from 3ca4c67 to 1713b1b Compare November 10, 2026 12:41
@Thecave3
Thecave3 force-pushed the fix/93-121-vanished-dapp-and-reconnect branch 2 times, most recently from 87c6b47 to d79a331 Compare November 11, 2026 01:43
@Thecave3
Thecave3 force-pushed the fix/97-repeat-subscription branch from 1713b1b to b69184e Compare November 11, 2026 01:43
A dApp that subscribed again to a RAN function it already had was told
"positive" with the existing subscription id, and the RAN kept the stored lists
and periodicity. But the response echoed the lists and periodicity of the repeat,
so it described a subscription that does not exist (#97). A dApp that subscribed
again to change its periodicity read the new value in the answer and kept the old
rate.

A repeat is still answered with the existing id, and the lists and periodicity in
the response are now the ones the RAN holds. A repeat the RAN refuses leaves the
subscription as it was, and one made after subscriptionTime ran out still renews
it in place. If the subscription ended between the check and the lookup, the
response reports no lists and no periodicity, which the grammar reads as "not
reported". To change a subscription a dApp deletes it and subscribes again, which
is also the only form that behaves alike on libe3, Aerial's agent and OCUDU.

Nothing changes on the wire, in the C API or in libe3py.

Specification and guide: 03 says a repeat does not change the subscription and
how to change one; the integrator guide gets the row and its pointers, which
follow the added lines; the Word edition is rebuilt. The interop page corrects
what it said about Aerial, whose agent adds a subscription for every request
and only whose dApp manager refuses a second one; calls OCUDU's one per repeat
a defect; drops the row that recorded the echo; and gets a ledger row.

Test: a dApp that subscribes again with other lists and another periodicity gets
the same id with the stored ones, the RAN keeps one subscription and starts the
SM once; a repeat with an identifier the function lacks is refused and changes
nothing; a dApp that registered again is answered with what it asked for. The
test fails on the code before this change.

VERSION 0.4.2.

Assisted-by: Claude:claude-sonnet-5-5
Signed-off-by: Thecave3 <thecave003@gmail.com>
@Thecave3
Thecave3 force-pushed the fix/93-121-vanished-dapp-and-reconnect branch from d79a331 to 0fbf154 Compare November 11, 2026 02:04
@Thecave3
Thecave3 force-pushed the fix/97-repeat-subscription branch from b69184e to ff4feb9 Compare November 11, 2026 02:04

This branch has not been deployed

No deployments
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.

1 participant