Skip to content

[Jetty] Added the Workflow wake target with rechecks and pruning. - #56

Draft
moetemp wants to merge 5 commits into
moe/jetty/js7-workflow-wake-foldfrom
moe/jetty/js8-workflow-wake-target
Draft

moetemp wants to merge 5 commits into
moe/jetty/js7-workflow-wake-foldfrom
moe/jetty/js8-workflow-wake-target

Conversation

@moetemp

@moetemp moetemp commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds the Workflow wake target. A Workflow reader attaches with workflow_target, and the notifier wakes it through History.

  • The stream_wake callback variant sends progress to History RecordStreamWake. Its completion is the close, a resubscribe after an idle timeout, or nothing after a detach.
  • An attach reserves the reader's place first, so an attach past history.maximumStreamWakeSources readers at once, or to a closed run, fails. A detach, a failed attach, and a taken close or resubscribe wake free the place.
  • A close wake carries no close result, and a close failure only up to 4 KiB, since one scheduled event carries the wakes of all of a run's readers. The reader's final read returns the outcome from the store.
  • A delivery that finds the run closed marks the callback, and the notifier drops it from its limits (JD-6).
  • After streamnotifier.recheckInitial (1 min) of quiet the notifier sends a recheck wake, doubling up to streamnotifier.recheckMax (1 h). A notification resets the gap.
  • Progress deliveries are numbered, so a recheck at an old counter, or zero, goes out.
  • streamnotifier.ownerCheckInterval drops from 5 min to 30 s. An implicit close then reaches waiting callbacks within about 30 s plus the grace, at one owner describe per interval per notifier with callbacks.

Why?

A Signal would add an event and an Action per wake (JD-5). Rechecks close the crash gap without a Redis outbox (JD-10). Dead callbacks must not fill the 2,000 limit (JD-6). With Ford gone, the owner check is the only implicit close (JD-9).

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

Unit tests in chasm/lib/callback and chasm/lib/streamnotifier (TestWorkflowTargets, TestRechecks), and the functional TestStreamWakeSuite end to end through the notifier.

A Workflow reader in the namespace attaches a stream_wake callback, and the notifier wakes it through History with no Nexus. Rechecks bound the delay after a lost notification, and callbacks of closed runs leave the limits.
No Worker closes a stream when its owner's chain ends, so the owner check bounds an implicit close.
A run counted every reader it ever attached, so the 33rd reader failed the Workflow even with
one reader open. A detach, a failed attach and a taken close or resubscribe wake free it.
One scheduled event carries the wakes of all of a run's readers, so near-limit outcomes could
stack past the event limit. The reader's final read returns the outcome from the store.
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