Repository navigation
feat: IPC for the Driver-/Unit framework (SHM, Event Bus, Message Queue) - #3
Merged
Merged
Conversation
… (EB-3/5/6, EB-1/2/4) Add IPC potentials source document.
… MQ-6) - RequestReply envelope with correlation id, sync call(timeout), handler loop - CorrelationId generator, timed receive primitive - MessageQueueShmCore lock-free Vyukov ring in shared memory with API parity - MessageQueueBackend flag + factory, example and tests
…(SHM-1, SHM-2) - SharedMemoryRepository<T> object store with find_or_construct and registry - ArrayShm/RingBufferShm (Vyukov MPMC)/QueueShm containers in shared memory - ShmView/ShmSlice span-like views with generation/staleness checks
Scheduler-driven scan/apply with dry-run, PID liveness guard, DB reconciliation, idempotent.
…nd ops endpoints (MQ-1, MQ-3, MQ-5) - MessageQueueOwner model + schema owner columns, heartbeat and reclaimOrphans - Bootstrap plugin reconciliation of stale queues - Overflow/dead-letter policy API on MessageQueueCore - CLI stats/purge and HTTP stats/purge endpoints with DTOs
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
The clang-tidy gate re-enables bugprone-easily-swappable-parameters and performance-unnecessary-value-param for changed files, so the NOLINT comments added with the IPC work no longer satisfy it. Replace them with real named aggregates and strong types and pull those through interface, mock, controller, service, CLI, examples and tests: - MessageQueueQuery.h (new): MessageQueueFilter, MessageQueueOwnerRegistration, MessageQueueOwnerStateUpdate - MessageQueueEntry.h: MessageQueueOwnerColumns - EventBusEntry.h: EventBusCapacities - MessageQueueRequestReply.h: RequestReplyQueues - ShmView.h: shm::ShmGeneration for the view constructors - SharedMemoryRepository.h: ShmCell::Layout and ShmCell::InitArgument - RingBufferShm.h: byte-pointer buffer base, drops the int-to-ptr casts - DropPolicy/EventPriority/MessageQueueBackend narrowed to std::uint8_t - empty catches now log via LOG_WARN
CodeQL flags a std::byte * base scaled by bytes (cpp/suspicious-pointer- scaling) when it is reinterpret_cast'ed from a wider object pointer, while clang-tidy rejects the integer-to-pointer cast that avoids it. Use the typed form where it exists and the project's documented integer-domain form otherwise: - MessageQueueShmCore::payloadOf advances SlotHeader * by one element (sizeof(SlotHeader) == kSlotHeaderSize), so it needs no cast at all - slotAt and ShmCellRecord::payload keep the byte offset but materialise the address in the integer domain, same pattern as EventBus::ShmRing
CodeQL reports the std::apply lambda's parameter pack as hiding the repository's own constructor-argument parameter.
| template<typename... Args> static void construct(void *payload, ShmCell::InitArgument initArgument) | ||
| { | ||
| const auto &arguments = *static_cast<const std::tuple<std::decay_t<Args>...> *>(initArgument.value); | ||
| std::apply([payload](const auto &...ctorArgs) { ::new (payload) T(ctorArgs...); }, arguments); |
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.
Summary
Makes the IPC layer (Shared Memory, Event Bus, Message Queue) actually usable for the planned Driver-/Unit framework. Implements the full plan in
docs/ipc-driver-unit-plan.md— all phases A, B and C.Plan:
docs/ipc-driver-unit-plan.md(tracking tables, all rows marked done)Potentials source:
docs/ipc-potencials.mdWhat changed
Shared Memory
SharedMemoryRepository<T>(object store) +ArrayShm/RingBufferShm(lock-free Vyukov MPMC) /QueueShmcontainers in shared memory, plusSharedMemoryRepositoryRegistry.ShmView/ShmSlicegeneration-aware, span-like zero-copy views with staleness checks.BeforeGrow/AfterGrow/BeforeShrink/AfterShrink/OnRemap).SharedMemorySegmentStats(allocated/free bytes, grow/shrink/recovery counts, generation).SharedMemoryCleanupService— scheduler-driven orphan cleanup with dry-run, PID liveness guard, DB reconciliation, idempotent.Event Bus
Event,EventSchemaRegistry.Fail/DropOldest/DropNewest/Block), defaultFail(backward compatible).TopicMatcher(*,?), exact-match fast path.busQueueDepth,subscriberQueueDepth, drop counts).Message Queue
MessageQueueOwner), heartbeat,reclaimOrphans, schema owner columns, bootstrap reconciliation.call(timeout), handler loop.Fail/DropNewest/DropOldest/BlockWithTimeout/DeadLetter).MessageQueueShmCore, lock-free ring) withMessageQueueCoreAPI parity and backend flag.Compatibility
Fail), only additive changes; SHM/Event layouts extended without breaking existing fields.Tests
tests/MessageQueueRpcTest.cpp,tests/features/MessageQueueShmCoreTest.cpp,tests/features/SharedMemoryRepositoryTest.cpp,tests/features/ShmViewTest.cpp,tests/features/SharedMemoryCleanupServiceTest.cpp; extendedtests/events/EventBusTest.cpp, CLI/HTTP/repository/plugin tests.-Werror; 1194/1194 unit tests pass;check-format/check-namespace/check-secretspass.Notes for reviewers
docs/ipc-potencials.mdis the source document added alongside the plan.[x] Erledigt; progress footer shows 7/7 · 6/6 · 3/3.