Skip to content

[rust-LIN-05] Adapter DropOldest back-pressure policy behaves identically to DropNewest #31

Description

@SoundMatt

Location

src/adapt.rsLinAdapter::subscribe's back-pressure handling, inside the spawned forwarding task.

Problem

When the adapter's internal channel is full, the BackPressurePolicy::DropOldest arm executes the exact same statement as the DropNewest arm — a plain let _ = tx.try_send(msg); — instead of first draining the oldest queued message to make room for the new one. As written, selecting DropOldest produces identical runtime behavior to DropNewest: the incoming message is simply dropped when the channel is full, and the queue is never evicted from the front. The policy is effectively a no-op distinct from DropNewest — anyone configuring DropOldest expecting newer frames to displace older ones gets the opposite behavior with no indication anything is wrong.

Suggested fix

Implement true oldest-eviction for the DropOldest arm (e.g., on try_send failure, pull one item off the receiving side and retry the send), or switch to a channel type that supports ring-buffer-style eviction. Add a test that asserts the oldest message is the one evicted under load, distinguishing it from the DropNewest behavior.


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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions