Decouple dApp-report handling from the inbound thread via a reusable LockFreeQueue#13
Merged
Conversation
Contributor
📊 MPMC Queue Benchmark Results (commit
|
| Queue Capacity | P50 (ns) | P95 (ns) | P99 (ns) | P99.9 (ns) |
|---|---|---|---|---|
| 16 | 684 | 995 | 1075 | 8218 |
| 64 | 2768 | 4051 | 4441 | 26502 |
| 256 | 2307 | 8458 | 26071 | 39085 |
| 1024 | 35419 | 39276 | 43734 | 44035 |
| 4096 | 27223 | 46740 | 47552 | 47732 |
LockFreeQueue End-to-End Latency (SPSC, 30000 items per queue size)
| Queue Capacity | P50 (ns) | P95 (ns) | P99 (ns) |
|---|---|---|---|
| 16 | 1035 | 2207 | 2388 |
| 64 | 3920 | 7076 | 7276 |
| 256 | 18507 | 28957 | 33155 |
| 1024 | 113176 | 144455 | 159292 |
| 4096 | 486782 | 510627 | 512480 |
Throughput (400000 items per configuration)
| Configuration | Queue Cap | Throughput (Mops/s) |
|---|---|---|
| SPSC (1P×1C) | 256 | 15.23 |
| MPSC (4P×1C) | 1024 | 11.07 |
| MPMC (4P×4C) | 4096 | 13.25 |
| MPMC (8P×4C) | 4096 | 10.62 |
Stress / Correctness (100000 items each)
| Test | Items | Result |
|---|---|---|
| SPSC (1P×1C) | 100000 | ✅ PASS |
| MPSC (4P×1C) | 100000 | ✅ PASS |
| MPMC (4P×4C) | 100000 | ✅ PASS |
| MPMC (8P×8C) | 100000 | ✅ PASS |
Benchmarked on
ubuntu-latest, Release build
Collaborator
|
Not sure which PR is fixing this now. The comments of the other PRs applies here as well |
Thecave3
requested changes
Jun 4, 2026
Thecave3
left a comment
Collaborator
There was a problem hiding this comment.
some things are not valid anymore, anyway don't use directly the mcpm queue but use the same logic of the response queue
…l use and added tests
587fe27 to
07c0d4c
Compare
Contributor
⏱️ Full-loop Latency Benchmark (commit
|
| Phase | mean | p50 | p99 | max |
|---|---|---|---|---|
| 1. Collect indication data | 0 | 0 | 0 | 10 |
| 2. Create & encode indication | 0 | 0 | 1 | 16 |
| 3. Deliver indication (RAN -> dApp) | 97 | 95 | 161 | 178 |
| 4. Decode indication | 0 | 0 | 0 | 11 |
| 5. Process data | 0 | 0 | 0 | 0 |
| 6. Create & encode control | 0 | 0 | 0 | 10 |
| 7. Deliver control (dApp -> RAN) | 108 | 105 | 179 | 228 |
| 8. Decode & handle control | 0 | 0 | 0 | 15 |
| Total round-trip | 209 | 195 | 327 | 358 |
Benchmarked on
ubuntu-latest, Release build, ZMQ + IPC, ASN.1 APER.
Contributor
🔄 E2E dApp Integration Results (commit
|
Contributor
🔀 E2E Topologies — multi-dApp / multi-RAN (commit
|
Two races on the shared /tmp/dapps IPC directory caused test_e2e_report_path to fail intermittently in CI (agent.start() returning CONNECTION_FAILED) under `ctest --parallel`, while passing in serial local runs: 1. The ZMQ connector treated any mkdir(/tmp/dapps) failure as fatal. Concurrent agents race between stat() and mkdir(); the loser gets EEXIST. Now ignore EEXIST, matching the POSIX connector. 2. Both connectors called rmdir(IPC_BASE_DIR) on dispose. Since the directory is shared, a finishing agent removed it out from under another agent that had already stat()'d it and was about to bind a socket inside it, making that bind fail with ENOENT. Drop the rmdir; leaving the empty shared directory behind is harmless.
9abb1d2 to
475d655
Compare
Thecave3
approved these changes
Jun 12, 2026
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.
Moves
handle_dapp_report()off the RAN inbound (ZMQ-recv) thread so downstream OAI/iApp work can no longer stall inbound reads. Reports are handed to a dedicated worker thread through a bounded lock-free queue.What changed
DAppReportonto areport_queue_; a dedicatedreport_worker_thread_drains it and invokeshandle_dapp_report(). The worker is started only on the RAN role (the side that receives dApp reports).Pdu-specificResponseQueueis generalized into a header-onlyLockFreeQueue<T>(adaptive 3-phase spin-wait blocking pop +shutdown()semantics over the existingMpmcQueue<T>). Both paths now share it:LockFreeQueue<Pdu>(outbound) andLockFreeQueue<DAppReport>(inbound reports). No back-compat alias — renamed throughout.pop(timeout)+shutdown(), mirroring the outbound loop.Tests
test_response_queue.cpp->test_lockfree_queue.cpp(nowLockFreeQueue<Pdu>, plus aDAppReportspecialisation case).test_report_drop.cpp: unit tests for the report queue (FIFO, explicit overflow, burst-producer/slow-consumer, multi-producer no-loss/no-dup) against the productionLockFreeQueue<DAppReport>wrapper.test_e2e_report_path.cpp: end-to-end integration test driving a real E3Agent + fake dApp ZMQ peer through the full inbound pipeline to the registered handler.Note
The original
ZMQ_CONFLATEremoval from this branch is dropped — it already landed onmainindependently (commit 398a17e, "fix ZMQ multi-dApp fan-out"). This PR is now strictly the worker-thread decoupling + queue refactor.