Skip to content

Svc: drop periodic Sched/Ping ticks on queue-full instead of asserting - #2

Open
Mikefly123 wants to merge 1 commit into
fix/com-aggregator-bounded-timeoutfrom
fix/sched-tick-drop-annotations
Open

Svc: drop periodic Sched/Ping ticks on queue-full instead of asserting#2
Mikefly123 wants to merge 1 commit into
fix/com-aggregator-bounded-timeoutfrom
fix/sched-tick-drop-annotations

Conversation

@Mikefly123

Copy link
Copy Markdown

What

Adds the drop qualifier to periodic Svc.Sched/Svc.Ping async input ports on 8
Svc components, so a queue-full condition on these periodic ticks drops the tick
instead of tripping the autocoded queue-full assertion. Prevents a stalled/slow
component from crashing the system on a missed housekeeping tick.

Base branch note

This PR targets pcr-usp-base, a branch pinned at 8a62e455a90b6d4f498c332d45d65a2a819988d8
(the v4.2.2-era commit that lib/fprime is pinned to in
proves-core-reference#439),
not devel, which has diverged significantly from that pinned commit. See
fix/com-aggregator-bounded-timeout PR for the same rationale.

Provenance

Cherry-picked from Mikefly123/fprime branch fix/sched-tick-drop-annotations
(commit bc4641af3) onto pcr-usp-base. Cherry-pick auto-merged cleanly against the
older base for 16 of 18 touched .fpp files. Two files in the source branch
(Svc/BufferAccumulator/BufferAccumulator.fpp, Svc/FileDispatcher/FileDispatcher.fpp)
carried the same drop annotation on newer-upstream-only ping ports that are out of
scope for the carried patch; those two hunks were reverted from this branch to keep
scope identical to the carried patch.

Verified byte-equivalent: git diff pcr-usp-base..fix/sched-tick-drop-annotations is
byte-for-byte identical to applying the carried patch
fprime-sched-tick-drop.patch to a pristine checkout of 8a62e455. No extras.

Related

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9c418c81-a66b-447c-9e04-cfd30ca16862

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Adds the drop queue-full annotation to two classes of periodic async
input ports across Svc, where none currently exists:

1. The Svc.Sched async input on active components that receive a rate-
   group tick but did not have drop set: CmdSequencer.schedIn,
   CmdDispatcher.run, TlmChan.Run, TlmPacketizer.Run, FileDownlink.Run,
   BufferLogger.schedIn, DpManager.schedIn, DpWriter.schedIn.
2. PingIn/pingIn async ports across Svc, including
   ActiveRateGroup.PingIn and FpySequencer.pingIn (the latter previously
   priority 10 assert, with an open TODO questioning priority/behavior),
   plus two ports added upstream since this defect class was first
   scoped: BufferAccumulator.pingIn and FileDispatcher.pingIn.

This is the same defect class fixed for ComAggregator (see companion
PR): any active component fed periodic ticks by a rate group can, if its
own dispatch thread stalls longer than queue_depth / tick_rate,
accumulate enough queued ticks to trip the autocoded FW_ASSERT on
queue-full -- turning a transient stall into an unrecoverable
FATAL/reboot.

Captured on hardware (PROVES CubeSat, RP2350/Zephyr) during HWIL soak
testing, in two independently reproduced instances:
- CmdSequencer::schedIn_handlerBase (10 Hz sched tick) hit the identical
  QUEUE_FULL assert as the ComAggregator case, while a sequencer's
  dispatch thread was stalled.
- ActiveRateGroup::PingIn_handlerBase hit the same assert via
  Svc::Health's 1 Hz ping -- the health-check mechanism itself killed
  the board. Health's ping-timeout policy exists specifically to detect
  an unresponsive component and react gracefully; asserting on the ping
  enqueue short-circuits that design.

Both classes of tick (rate-group sched, and ping) are periodic and
idempotent by construction -- a dropped tick is simply retried on the
next cycle -- so drop is behaviorally safe. Upstream already uses drop
for exactly this reason on ComQueue.run and ActiveRateGroup.CycleIn;
this extends the same reasoning to the remaining periodic producers
that were missed.

Related to issue nasa#4195 ("Add a 'Drop But Warn' on Queue Full"), which is
in the same design space but currently leans assert-by-default; this
change is narrower in scope (periodic/idempotent producers only,
per-port opt-in via the existing drop annotation, no new mechanism).

This is an fpp-only annotation change consumed by the autocoder; no new
C++ logic. A reviewer sweep of existing per-component UTs that assert on
QUEUE_FULL behavior for these ports is recommended before merge.

Generative AI (Claude, Anthropic) was used to help root-cause this
defect class during HWIL debugging (two independently captured hardware
instances of the same assert) and to enumerate affected ports; disclosed
per AI_POLICY.md in the upstream pull request description.
@Mikefly123
Mikefly123 force-pushed the fix/sched-tick-drop-annotations branch from 07ecfbb to a7b34ce Compare July 31, 2026 03:00
@Mikefly123
Mikefly123 changed the base branch from pcr-usp-base to fix/com-aggregator-bounded-timeout July 31, 2026 03:00
@Mikefly123

Copy link
Copy Markdown
Author

Stack position 2/3 of stack nasa#6: #1#2#3, base fix/com-aggregator-bounded-timeout (rebased onto #1, force-pushed). Linked via gh stack link.

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