Skip to content

BackoffSupervisor — stash survives multiple preStart failures #67

@pathosDev

Description

@pathosDev

The BackoffSupervisor v1 (#48) drains the stash to the new child immediately on respawn — the `drainGraceMs` window protects messages stashed during the previous backoff window from being lost when the new child crashes in preStart. But messages that arrive between two failed respawn attempts are still forwarded directly to the about-to-crash child and dead-letter when it fails.

The v1 commit explicitly noted this as a v2 enhancement.

Scope:

  • Track `childConfirmedAlive` flag. Set on `READY_TICK` (after `drainGraceMs` of survival). Cleared on `Terminated`.
  • New messages forwarded only when `childConfirmedAlive === true`. Otherwise stashed.
  • When child eventually survives the grace window, both old-stash and during-grace-stash drain to it.
  • Trade-off: every fresh respawn adds `drainGraceMs` latency to the first message in the happy path. Make it configurable (default = current behaviour, opt-in to the strict mode).

Verification:

  • Test with a child that fails preStart 3× then succeeds. Send a message between each attempt. After stabilisation, verify all messages arrived.

Estimate: 1-2 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: lowNice-to-have / niche / demand-driven

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions