Skip to content

feat: discard stopped member work - #74

Merged
ReubenBond merged 4 commits into
mainfrom
rb-discard-stopped-member-work
Nov 18, 2026
Merged

ReubenBond merged 4 commits into
mainfrom
rb-discard-stopped-member-work

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 725dc475adcf7412c2968d8266934452d21eac0a

Dimension Assessment Rationale
Change confidence 9.5/10 Full Debug and Release suites, repeated scheduler/race/replay stress, package smoke, all seven packs, and Linux/Windows/macOS CI pass at this revision.
Diagnosis confidence 9.5/10 Cluster disposal intentionally drains attached member work, so an abandoned member deadline can advance virtual time or exceed the disposal bound unless that member has an explicit terminal cleanup boundary.
Evidence fit 9.5/10 The 9/11-minute regression directly reproduces the reported disposal behavior and verifies callback suppression, unchanged virtual time, and successful disposal.

Summary

  • Add SimulationNodeContext.DiscardPendingWork() and terminal SimulationNodeState.Discarded semantics for consumers which have already stopped or crashed a member.
  • Seal the member's SimulationNodeIdentity in the scheduler, cancel ready/delayed lane work, callback timers and virtual deadlines, readiness work, controlled operations/resource waits, and context-owned shared callbacks such as SuspendFor resume.
  • Reject future node-owned enqueue through lane, task scheduler, synchronization context, timer, continuation, readiness, and direct scheduler paths while leaving other nodes and cluster-global work unchanged.
  • Preserve ordinary SimulationCluster.DisposeAsync draining for members which were not explicitly discarded; exclude discarded members from ActiveNodes and pending-work diagnostics.
  • Document the exact lifecycle, disposal, active-callback, suspended, idempotency, and post-disposal contracts.

Relates to ReubenBond/fast-caspaxos#25.

Ownership model

SimulationNodeIdentity is the authoritative kernel ownership key. SimulationNodeContext additionally owns physical lane items and the cluster-lane SuspendFor registration, so the public transition seals scheduler admission first and then cancels both ownership domains without invoking discarded callbacks.

Explicit cluster-lane work (node: null) remains cluster-owned. Uninstrumented/external work outside the controlled scheduler is not member-owned by Clockwork and is not discarded.

Validation

  • Focused discard suites: 17/17 passed.
  • Full Debug suite: 4,686 passed, 30 skipped, 0 failed.
  • Full Release suite: 4,686 passed, 30 skipped, 0 failed.
  • Release stress repetitions: race 633/633, scheduler 42/42, replay 492/492.
  • Package smoke: 46/46 passed; all seven NuGet packages packed successfully.
  • CI: build plus Ubuntu, Windows, and macOS cross-platform jobs passed.
  • Repository-wide dotnet format --verify-no-changes remains blocked by pre-existing chore: fix ControlledParallel formatting drift #70 in untouched ControlledParallel.cs.

@ReubenBond
ReubenBond merged commit 65f5be6 into main Nov 18, 2026
4 checks passed
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