Skip to main content
← Back to list
01Issue
BugOpenSwamp CLIPublicTeam
AssigneesNone

Relationships

#4048 Pausing a schedule does not stop ordinary fires already queued

Opened by nckrtl · 10/27/2026

Pausing a schedule leaves ordinary cron fires already waiting in the scheduler queue runnable. This prevents a maintenance pause from becoming idle. Manual runs should remain available.

Affected binary: 20261022.021804.0-sha.983e2929. The same runEntry condition remains on upstream main as checked on 2026-10-27. I followed CONTRIBUTING.md and am submitting a report rather than an external code PR.

Reproduction with a real isolated serve:

  1. Keep the default single scheduled-run slot occupied with a workflow waiting on a test barrier.
  2. Set another workflow to fire every second and wait until /health shows at least two ordinary queued fires for it.
  3. Pause both schedules through workflow schedule pause --server .... schedule list reports both paused.
  4. Release the first workflow and wait for idle.
  5. The second workflow still starts once for each queued fire while its schedule is paused.

A native scheduler regression reproduced queuedBeforePause: 2, startsAfterPause: 2. With the minimal change below it reports startsAfterPause: 0. Ten existing pause/replay tests also pass after that change.

Root: src/libswamp/workflows/scheduled_execution.ts checks pauses in handleFire before enqueueing. In runEntry, it checks them again only when entry.replayed is true. Ordinary queue entries predate the pause too. Their pending records should still be consumed, but the pause should suppress execution.

Minimal proposed change in runEntry:

-      // A replayed fire was recorded before a restart; the schedule may have
-      // been paused since. Its pending entry is consumed either way.
-      if (entry.replayed && this.deps.schedulePauses) {
+      // A queued fire may predate a pause, whether from this process or a
+      // previous one. Its pending entry is consumed either way.
+      if (this.deps.schedulePauses) {
...
-            replayed: true,
+            replayed: entry.replayed ? true : undefined,
+            fireTime: entry.fireTime?.toISOString(),

Regression to add beside the existing scheduler pause tests: hold the scheduler slot with a blocking executor; let two ordinary fires queue for another workflow; save that workflow's pause through the pause repository; release the executor; require that the queue settles without any execution of the paused workflow. Keep the existing replay-pause and manual-run tests. Checking only a fresh paused cron fire or a restart replay misses this path.

The manual explicitly says additional fires can queue while a workflow is queued, while fires during its execution are skipped. There is no skip-if-queued option. This report asks only for pauses to be rechecked when ordinary queued fires are dispatched, preserving the existing queue policy.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/27/2026, 8:56:46 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.