Skip to content

Add cap for parked tasks in send scheduler #4092

Description

@stubbsta

Background

Budget-parked tasks are exempt from the reaper (firstAdmittedTime is never set) and taskCache has no cap, so sustained over-budget sends grow the backlog without bound and deliver arbitrarily late. Flagged as an accepted review finding on #4062.

Details

Expire never-admitted parked tasks once messageAge() exceeds a configurable maximum, emitting MessageErrorEvent so the application gets explicit feedback. Additionally enforce a configurable hard cap on taskCache, rejecting new sends with backpressure feedback when full.

Acceptance criteria

  • A parked task past the age limit is dropped with a MessageErrorEvent; taskCache never exceeds the cap, and sends beyond it are rejected with feedback rather than silently queued.
  • Tasks admitted before the age limit are unaffected — the existing park→release-on-epoch-roll behavior stays green in the scheduler tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status
    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions