Skip to content

[Bug]: Superseded cron reconciliation blocks newer scheduler projections #104363

Description

@steipete

Bug type

Behavior bug (incorrect state without a crash)

Beta release blocker

No

Summary

When a cron_reconciled observer is still running, a newer scheduler reconciliation waits behind that stale callback and cannot promptly replace or abort the old host projection.

Steps to reproduce

  1. Register a cron_reconciled handler whose startup projection remains pending.
  2. Complete the startup scheduler reconciliation.
  3. Hot-reload cron state so a newer scheduler owns the next projection.
  4. Observe that the reload callback does not run until the startup callback resolves.

Expected behavior

The newer lifecycle generation immediately supersedes the older reconciliation, aborts its cooperative host write, and dispatches the exact replacement scheduler without waiting behind stale work.

Actual behavior

src/gateway/server-cron-reconciled.ts serializes every reconciliation through one dispatchTail. The newer callback is head-of-line blocked even after the lifecycle generation changes, so an external wake scheduler can retain a stale snapshot.

OpenClaw version

Current main at c48cbabfc18a8b20691b479840f7756237d7eb92.

Operating system

Platform-independent.

Install method

Source checkout.

Model

N/A.

Provider / routing chain

N/A.

Logs

The focused regression holds the startup callback, arms reload reconciliation, and observes that reload cannot receive the replacement scheduler until the stale callback is manually released.

Impact and severity

Affected: hosts projecting OpenClaw cron wakes into an external scheduler.

Severity: high for scale-to-zero deployments because a stale wake projection can miss, delay, or resurrect scheduled work.

Frequency: deterministic whenever an earlier projection is slow or retrying during reload.

Consequence: the documented full-snapshot adapter cannot abort stale acceptance promptly.

Additional information

Introduced with the serialized reconciliation lifecycle in #104191. Related documentation landed in #104227. The completed feature/docs work should stay closed; this is a focused cross-generation cancellation regression.

Metadata

Metadata

Assignees

Labels

maintainerMaintainer-authored PR

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions