Skip to content

[cpp-LIN-12] DropOldest back-pressure counts an eviction as a successful delivery, never as a drop #41

Description

@SoundMatt

Location: src/virtual/bus.cpp (~lines 112-116); include/lin/channel.hpp (send_drop_oldest, ~lines 58-65)

Finding: Under the DropOldest back-pressure policy, the bus calls a channel method that silently pops the oldest queued item when the channel is full, then unconditionally increments the delivered-message/delivered-bytes counters — never the drop counter. The RELAY spec defines the drop counter as counting one increment per sample discarded due to back pressure under either drop policy. So a DropOldest send that actually evicts an old item under-counts drops and over-counts deliveries, which breaks metric comparability against other protocol implementations that count this correctly (the DropNewest path in this same file does count drops correctly).

Recommendation: Have the drop-oldest send method report back whether it actually evicted an item (e.g. return an eviction flag/count), and only increment the delivery counters when no eviction occurred; increment the drop counter when it did.

Filed from the 2026-07-29 ecosystem audit register; independently re-verified against current HEAD before filing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions