Skip to content

fix(Svc): never FATAL on comms overload — drop instead of assert - #4

Open
Mikefly123 wants to merge 7 commits into
develfrom
fix/471-never-fatal-comms
Open

fix(Svc): never FATAL on comms overload — drop instead of assert#4
Mikefly123 wants to merge 7 commits into
develfrom
fix/471-never-fatal-comms

Conversation

@Mikefly123

Copy link
Copy Markdown

Problem

Three FW_ASSERT sites turn transient overload into an unrecoverable fatal cascade:

  1. Svc::Ccsds::SpacePacketFramer::dataIn_handler — a failed bufferAllocate (pool exhausted) feeds an invalid buffer into serializeFrom, which FW_ASSERTs.
  2. Svc::CmdSequencer schedIn/pingIn — queue-full on a 10Hz sched tick or health ping FW_ASSERTs in the generated handler base.
  3. Svc::ActiveRateGroup PingIn — same queue-full assert (CycleIn already has drop).

Observed on PROVES flight hardware (RP2350/Zephyr): one stalled SD write during a 204KB file uplink backed buffers up until the comms pool exhausted, producing 660 CmdSequencer schedIn asserts in a single run, stopping the watchdog, and leaving the processor byte-silent until power cycle (Open-Source-Space-Foundation/proves-core-reference#471).

Fix

  • SpacePacketFramer: on invalid/undersized allocation, drop the frame with a new throttled FrameDropped WARNING_HI event, return the data buffer via dataReturnOut, and emit a substitute comStatusOut SUCCESS so the ComQueue handshake keeps flowing. Safe: ComQueue.comStatusIn is async (no re-entrancy), and the dropped frame never reaches the driver so status tokens stay 1:1.
  • CmdSequencer schedIn/pingIn, ActiveRateGroup PingIn: drop semantics. A missed sched tick resumes bookkeeping next cycle; a missed ping surfaces as a late-ping health warning rather than a crash.

Verification

On the hardware that reproduced the FATAL 2/2: full UART file-transfer integration suite (9 tests incl. two 204KB round trips and three consecutive 204KB uplinks) green from one boot; induced pool exhaustion now degrades to FrameDropped/NoBuffsAvailable/HLTH_PING_LATE warnings with the board fully commandable.

Companion changes: OSSF/fprime-extras fan-out map capacity PR + proves-core-reference config/topology PR (pin bump lands there). Intended for upstream (nasa/fprime) submission after review here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WpBURCutAx8281i59nj6fo

LeStarch and others added 6 commits April 14, 2026 13:09
Works around the fact that `external parameters` don't respect default values.
* Add website local rendering and improve navigability

* update docstring

* Change file permissions to appease CI ??
* Fix FileWorker compatibility with 32-bit baremetal platforms

* Improve non-Posix registration of FileTester

Co-authored-by: Copilot <copilot@github.com>

* use STATUS instead of INFO

---------

Co-authored-by: thomas-bc <thomas.boyerchammard@gmail.com>
Co-authored-by: Copilot <copilot@github.com>
Three FW_ASSERT sites turned transient overload (e.g. an SD-stalled
FileUplink backing buffers up until the com buffer pool exhausted) into a
fatal cascade that left the flight processor unrecoverable:

- Ccsds::SpacePacketFramer: bufferAllocate failure fed an invalid buffer
  into serializeFrom -> FW_ASSERT. Now drops the frame with a throttled
  FrameDropped WARNING_HI event, returns the data buffer upstream, and
  emits a substitute comStatus SUCCESS so the ComQueue handshake keeps
  flowing (comStatusIn is async on ComQueue, so no re-entrancy; the
  dropped frame never reaches the driver, preserving 1:1 status tokens).
- CmdSequencer schedIn/pingIn: queue-full on the 10Hz tick or a health
  ping FW_ASSERTed. Both are droppable -- a missed tick resumes timer
  bookkeeping next cycle, and a missed ping correctly surfaces as a
  late-ping health warning instead of a crash.
- ActiveRateGroup PingIn: same queue-full assert, same drop rationale.

Observed on PROVES flight hardware (RP2350/Zephyr): a single stalled SD
write during a 204KB file uplink produced 660 CmdSequencer schedIn asserts
in one run, stopped the watchdog, and required a power cycle. With these
changes the same overload degrades to dropped frames and health warnings
with the board fully commandable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpBURCutAx8281i59nj6fo
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Mikefly123, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2dbb5bbc-1eb3-4db7-9de5-9324dbdde7be

📥 Commits

Reviewing files that changed from the base of the PR and between 702ae21 and fc2d7aa.

📒 Files selected for processing (12)
  • .nav.yml
  • Svc/ActiveRateGroup/ActiveRateGroup.fpp
  • Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.cpp
  • Svc/Ccsds/SpacePacketFramer/SpacePacketFramer.fpp
  • Svc/CmdSequencer/CmdSequencer.fpp
  • Svc/FileWorker/CMakeLists.txt
  • Svc/FileWorker/FileWorker.hpp
  • Svc/FileWorker/test/FileTester/CMakeLists.txt
  • Svc/TlmPacketizer/TlmPacketizer.fpp
  • docs/.gitignore
  • docs/local-website-build.sh
  • requirements.txt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

5 participants