Skip to content

docs: S23.22 give the Datagram role an implementor contract, and Plus-TCP its exceptions - #737

Merged
DavidCozens merged 3 commits into
mainfrom
docs/plustcp-triage
Aug 10, 2026
Merged

docs: S23.22 give the Datagram role an implementor contract, and Plus-TCP its exceptions#737
DavidCozens merged 3 commits into
mainfrom
docs/plustcp-triage

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Purpose

The FreeRTOS-Plus-TCP triage. Its own removed content was fully accounted for
already — the lede, the manifest table and the ipconfigUSE_DNS requirement all
survived the restructure — so the value here was verifying the page's claims
against the code, and two things came out of that.

Part of #708

Change Description

SolidSyslogDatagramDefinition.h gains an implementor contract. It said only
"per-method contract is on the wrappers", so what an implementor must guarantee
was written nowhere. It now uses the split the Stream role already
uses — the caller-facing header says what a caller may expect, the Definition
header says what an implementor must deliver: report MaxPayload for the path in
use and never guess high, return OVERSIZE where the platform can distinguish
it, and return SENT only once the record has actually been handed to the
network.

SolidSyslogDatagram.h gains the consequence of a permission it already
grants.
It already says an implementation that cannot detect oversize may
collapse it into FAILED, so those platforms are conforming. What it did not say
is that the sender's trim is reactive — it offers the record at full size and
consults MaxPayload only once told the record was too large. So on those
platforms an over-large record is never trimmed: it reaches the stack whole and
is lost. Raised as #736.

FreeRTOS-Plus-TCP's page gains two exceptions, both verified in the adapter:

  • A first datagram to a peer outside the ARP cache stalls the calling task for up
    to 50 ms. The stack drops rather than queues while ARP resolves, so the adapter
    probes and yields. Sound, well commented in the source, and undocumented until
    now. It is paid by the application's thread on an inline wiring or the
    servicing thread on a buffered one.
  • An over-large datagram is lost rather than trimmed, per the above, with the
    sizing advice that mitigates it until fix: an oversize datagram is lost on any platform that cannot detect oversize #736 lands.

What deliberately did not change

docs/rfc-compliance.md's RFC 5426 §3.2 row stays Supported. Posix and
Windows detect oversize and trim, so the library with a conforming platform under
it meets the requirement; the platforms that do not are the exception, and the
exception is recorded on their pages. That the eventual fix may live in Core does
not make it any less a property of choosing this platform today.

Plus-TCP's @file briefs are 61–109 characters, inside the band the finished
platforms sit at, so they needed no work.

Test Evidence

Documentation, plus comment-only changes to two Core headers. mkdocs build --strict, markdownlint, python3 scripts/check_platform_docs.py (10 platforms,
12 roles, boundary clean), and clang-format --dry-run --Werror on both headers
— all green. No MISRA suppression references either header, so no renumbering. No
production logic changed.

Areas Affected

Core/Interface/SolidSyslogDatagram.h and SolidSyslogDatagramDefinition.h
(comments only), and docs/platforms/plustcp/index.md. No public API change.

Summary by CodeRabbit

  • Documentation
    • Clarified when oversized syslog datagrams are trimmed and how send outcomes are reported.
    • Documented lifecycle, payload-size reporting and implementation requirements for datagram providers.
    • Added FreeRTOS-Plus-TCP guidance covering ARP-related delays, oversized datagrams, potential send failures and recommended workarounds.

The Datagram vtable said only "see the wrappers", so what an implementor
must guarantee was nowhere. It says it now, in the split the Stream role
already uses: report MaxPayload for the path in use and never guess high,
return OVERSIZE where the platform can distinguish it, and SENT only once
the record has actually been handed to the network.

The caller-side header gains the consequence of the permission it already
grants. An implementation that collapses OVERSIZE into FAILED is
conforming, but the sender's trim is reactive — it offers the record at
full size and only asks MaxPayload once told the record was too large. So
on those platforms an over-large record reaches the stack whole and is
lost. Tracked as #736.

FreeRTOS-Plus-TCP is one of them, and its page says so, with the sizing
advice that mitigates it until the fix lands. Its other undocumented
behaviour is the 50 ms yield the datagram adapter takes on an ARP cache
miss, because the stack drops rather than queues while ARP resolves —
paid by whichever task made the call, on a first send and after cache
expiry.

Part of #708
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The PR clarifies SolidSyslogDatagram send and lifecycle contracts. It documents FreeRTOS-Plus-TCP ARP delays, payload limits, oversized datagram handling, and a message-size workaround.

Changes

Datagram documentation

Layer / File(s) Summary
Datagram API and vtable contracts
Core/Interface/SolidSyslogDatagram.h, Core/Interface/SolidSyslogDatagramDefinition.h
The documentation defines OVERSIZE, FAILED, and SENT semantics. It also defines conservative MaxPayload reporting, embedding and downcasting requirements, and idempotent Open/Close handling.
FreeRTOS-Plus-TCP behaviour guidance
docs/platforms/plustcp/index.md
The documentation describes ARP cache-miss delays, the 1232-byte payload limit, untrimmed oversized records, and the SOLIDSYSLOG_MAX_MESSAGE_SIZE workaround.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • cososo-ltd/solid-syslog#736 — Covers the same oversized datagram and FreeRTOS-Plus-TCP behaviour documented by this PR.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required docs scope and clearly summarises the Datagram contract and FreeRTOS-Plus-TCP documentation changes.
Description check ✅ Passed The description completes all required sections and provides clear purpose, implementation details, test evidence, and affected areas.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/plustcp-triage

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Core/Interface/SolidSyslogDatagram.h`:
- Around line 41-47: Update the send-result documentation in SolidSyslogDatagram
so implementations must not classify OVERSIZE as transient FAILED; either remove
that collapse behavior or define FAILED as “not sent; apply the caller’s
retention policy.” Ensure SolidSyslogUdpSender and SolidSyslog_Service semantics
remain consistent so oversized records do not block later records through
repeated retries.

In `@Core/Interface/SolidSyslogDatagramDefinition.h`:
- Around line 25-28: Clarify the MaxPayload documentation to state that it
applies to the destination selected by the current connection. Require callers
to close and reopen the datagram before changing destinations, or require
multi-destination implementations to return a conservative limit safe for every
supported destination.

In `@docs/platforms/plustcp/index.md`:
- Line 34: Update the platform documentation text to refer explicitly to the
FreeRTOS-Plus-TCP API as `FreeRTOS_sendto` instead of the ambiguous `sendto`,
including the existing ARP-resolution statement.
- Around line 45-57: Revise the workaround guidance in the “An over-large
datagram is lost rather than trimmed” section to state that setting
SOLIDSYSLOG_MAX_MESSAGE_SIZE to the PlusTcp UDP path’s supported payload, such
as 1232 bytes, only prevents oversized datagrams and truncates formatted
records. Explicitly note that the global limit also affects TCP and switching
senders, and do not describe it as preserving long records across transports.
- Around line 32-43: Update the “first send to an unresolved peer” section to
identify the adapter’s vTaskDelay(pdMS_TO_TICKS(50)) as the source of the wait,
note that configTICK_RATE_HZ affects its duration, and state that
ipconfigMAX_ARP_AGE controls when the cache-miss path can recur. Replace each
sendto reference with FreeRTOS_sendto and do not attribute the delay to
FreeRTOS-Plus-TCP or FreeRTOSIPConfig.h.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6f186256-c7ee-4fc6-8d3e-849af8388aff

📥 Commits

Reviewing files that changed from the base of the PR and between 6669b06 and 7fe8e89.

📒 Files selected for processing (3)
  • Core/Interface/SolidSyslogDatagram.h
  • Core/Interface/SolidSyslogDatagramDefinition.h
  • docs/platforms/plustcp/index.md

Comment thread Core/Interface/SolidSyslogDatagram.h Outdated
Comment thread Core/Interface/SolidSyslogDatagramDefinition.h Outdated
Comment thread docs/platforms/plustcp/index.md Outdated
Comment thread docs/platforms/plustcp/index.md Outdated
Comment thread docs/platforms/plustcp/index.md Outdated
The review was right that this is worse than a dropped record. A failed
send is treated as transient — the store keeps the record at its cursor
and offers the same one every servicing pass — so an over-large datagram
the stack rejects blocks everything behind it, rather than being lost on
its own.

FAILED staying transient is still correct, and the header now says why:
its usual causes are an unreachable collector, a wrong address, a stack
not yet up, all resolved outside the library, and holding the record
until they are is what an audit trail wants. Size is the one cause the
record itself carries, which is what makes it the exception.

The Plus-TCP workaround was too glib. SOLIDSYSLOG_MAX_MESSAGE_SIZE is
library-wide, so lowering it to fit this UDP path truncates records on
every transport the instance uses.

Also from the review: the 50 ms ARP wait is the adapter's own vTaskDelay
rather than anything the stack does, rounded by configTICK_RATE_HZ and
recurring as ipconfigMAX_ARP_AGE expires entries; FreeRTOS_sendto spelled
in full so it cannot be read as the POSIX call; and MaxPayload's path is
the destination currently being sent to.

Part of #708

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Core/Interface/SolidSyslogDatagram.h`:
- Line 49: Update the documentation sentence in the SolidSyslogDatagram API
comments to refer to the caller operation as SolidSyslogDatagram_MaxPayload,
reserving MaxPayload only for references to the vtable member.

In `@docs/platforms/plustcp/index.md`:
- Line 55: Update the sentence in the FreeRTOS_sendto documentation by adding a
comma after “it” and replacing “the send” with “the send operation,” preserving
the rest of the wording.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4ca030e7-95ee-4d96-ab25-d05fd3b04379

📥 Commits

Reviewing files that changed from the base of the PR and between 7fe8e89 and 6777d2a.

📒 Files selected for processing (3)
  • Core/Interface/SolidSyslogDatagram.h
  • Core/Interface/SolidSyslogDatagramDefinition.h
  • docs/platforms/plustcp/index.md

Comment thread Core/Interface/SolidSyslogDatagram.h Outdated
Comment thread docs/platforms/plustcp/index.md Outdated
@DavidCozens

Copy link
Copy Markdown
Collaborator Author

@coderabbitai pause

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews paused.

Two nits from the review. The caller-facing header referred to the
operation as MaxPayload, which is the vtable member's name; the caller
calls SolidSyslogDatagram_MaxPayload, and the header now says so. And a
comma after the subordinate clause on the Plus-TCP page.

CodeRabbit is paused on this PR, so this push does not spend a review.

Part of #708
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   JUnit   build-linux-gcc (Whole Project): ✅ successful — 1529 passed
   JUnit   build-freertos-host-tdd-plustcp (Whole Project): ✅ successful — 1881 passed
   JUnit   build-linux-clang (Whole Project): ✅ successful — 1460 passed
   JUnit   sanitize-linux-gcc (Whole Project): ✅ successful — 1460 passed
   JUnit   integration-linux-openssl (Whole Project): ✅ successful — 16 passed
   JUnit   integration-linux-mbedtls (Whole Project): ✅ successful — 14 passed
   JUnit   integration-windows-openssl (Whole Project): ✅ successful — 16 passed
   JUnit   bdd-linux-syslog-ng (Whole Project): ✅ successful — 49 passed, 3 skipped
   JUnit   bdd-windows-otel (Whole Project): ✅ successful — 46 passed, 6 skipped
   JUnit   bdd-freertos-qemu-plustcp (Whole Project): ✅ successful — 45 passed, 7 skipped
   JUnit   bdd-freertos-qemu-lwip (Whole Project): ✅ successful — 45 passed, 7 skipped
   JUnit   build-windows-msvc (Whole Project): ✅ successful — 1302 passed
   JUnit   build-linux-tunable-override (Whole Project): ✅ successful — 1460 passed
   ⚠️   Clang-Tidy (Whole Project): No warnings
   ⚠️   CPPCheck (Whole Project): No warnings


Created by Quality Monitor v4.15.0 (#82d77af). More details are shown in the GitHub Checks Result.

@DavidCozens
DavidCozens merged commit aa3ce55 into main Aug 10, 2026
37 checks passed
@DavidCozens
DavidCozens deleted the docs/plustcp-triage branch August 10, 2026 16:53
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