Repository navigation
Svc/GenericHub: drop message with event and counter on allocation failure instead of asserting - #278
Open
devin-ai-integration[bot] wants to merge 13 commits into
Open
devin-ai-integration[bot] wants to merge 13 commits into
devin-ai-integration[bot] wants to merge 13 commits into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
Original prompt from thomas.boyer.chammard
|
…lure instead of asserting Closes nasa#6166
…-connecting ground sees it
…sertions, (void) on ignored send_data results)
…ta, cmdRespIn drop wording, schedIn and msgType docs, malformed-command UT)
… (CmdSplitter consumes the ComBuffer before forwarding)
…lag + Fw::Logger) instead of throttle 5
…f-sink and deferred buffer return
…nded), transport requirements and sizing rule; hub-pattern and ComQueue SDD cross-references
devin-ai-integration
Bot
force-pushed
the
devin/1791764453-generichub-alloc-failure
branch
from
November 5, 2026 02:53
7e6c69f to
c7efba2
Compare
…e (local review iter 4)
…ize operator notes, APID wording (local review iter 4)
…ded formation; state the UDP trade-off in hub-pattern (local review iter 4)
…al review iter 4)
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.
Change Description
GenericHub::send_datano longer asserts whenallocatereturns an invalid buffer (null data, or smaller than the framed message). It now:deallocate;bufferInbuffers still go back onbufferInReturn);std::atomic<U32> m_numAllocationFailureson every drop, published as telemetryNumAllocationFailuresfrom a newsync input port schedIn: Svc.Sched;std::atomic<bool> m_reportingFailure.exchange(true)emitsevent BufferAllocationFailed(msgType: HubType, port, size)(WARNING_HI) and oneFw::Loggerline; later drops are only counted until the next successful send clears the flag;cmdDispIncommand, repliesEXECUTION_ERRORon the matchingcmdRespOutso the originator is not left waiting.The hub message type is now an FPP enum declared in the component (
enum HubType : U32 { HUB_TYPE_PORT, HUB_TYPE_BUFFER, HUB_TYPE_EVENT, HUB_TYPE_CHANNEL, HUB_TYPE_CMD_DISP, HUB_TYPE_CMD_RESP }, same values and wire format as before) so the event argument is typed in the dictionary. API note for projects: the C++Svc::GenericHub::HubTypeenum is replaced by the generatedSvc::GenericHub_HubType(HUB_TYPE_MAXbecomesGenericHub_HubType::NUM_CONSTANTS).New special ports
Log/LogText/Time/Tlm. Telemetry is written only fromschedIn(not on the failure path) because the hub is often its own event/telemetry sink and emitting synchronously would re-enter it while the pool is exhausted; existing deployments must wireschedInto a rate group to see the counter. TheFw::Loggerline is for the side of the link whose own event cannot get out through the exhausted hub.Documentation: the GenericHub SDD gains a "Transport formations" section that makes
hub.toBufferDriver -> Svc.ComQueue -> Svc.ComStub -> driverthe recommended hub wiring (bounded buffering across a link outage, outside the passive hub), with the transport requirements (message boundaries: UDP natively, TCP/UART through F´ framing plus a receive-side adapter the framework does not provide; UDP send errors stall the queued wiring until reconnect) and the sizing rule (D >= N,Q >= N + 8).hub-pattern.mdpresents the same wiring; the ComQueue SDD notes the hub as abufferQueueInproducer. The design behind this (hub stays passive, no in-hub queue,Svc.ComRetryexcluded) was settled with the maintainers before implementation.Rationale
CCB on nasa#6166: "don't assert, add event and counter". A pool exhaustion killed the FSW; now it is counted, evented and survivable, and the documented topology gives projects buffering across link outages without adding state to the hub.
Testing/Review Recommendations
Svc/GenericHubUTs: 14 pass (null / undersized allocation for every message type, deallocate of undersized buffer, one event + one logger line per episode re-armed by a successful send, counter viaschedIn, recovery,cmdDispInfail-back incl. malformed packet and a CmdSplitter-consumed buffer, hub as its own event sink with an empty pool — bounded re-entry — and with the pool recovering, buffer returned from another thread after the send). Full fprime UT suite 135/135 on currentdevel.NumAllocationFailures == 0, ComQueue depth telemetry, noBufferAllocationFailed/QueueOverflow). Companion PR: JPL-Devin/fprime-generic-hub-reference (linked below once open).send_datafailure branch and thecmdDispIn_handlerfail-back; theHubTypeenum move (same values, same framing); SDD "Allocation failure" and "Transport formations".Future Work
None planned: the queued hub topic was closed in favour of the documented topology; UDP recovery after a send error and a framing adapter for stream transports are documented limitations.
Contributor Checklist
AI Usage (see policy)
Implementation, FPP, unit tests and documentation were written by an AI agent following the component-development skills, under maintainer direction (requirements, once-per-episode reporting,
std::atomic,Fw::Logger, sched-port telemetry,cmdDispInfail-back, the FPP enum typing and the recommended-wiring decision were maintainer decisions). Validated with the GenericHub UTs, the full UT suite, and the fprime-generic-hub-reference GDS integration tests; reviewed locally with the F´ multi-agent review pipeline.AGENTS.md).IAMAI
Requested by: @thomas-bc-autobot