Skip to content

Delivery Queue Processor Only Runs on Recovery, Causing Multi-Hour Delays #21722

@Squabble9

Description

@Squabble9

Summary

Messages enqueued by cron jobs sit in the delivery queue for hours because the delivery processor only runs during gateway restart/recovery, not continuously.

Environment

  • OpenClaw version: 2026.2.19-2
  • OS: Ubuntu Linux 6.8.0-90-generic
  • Gateway: systemd service, loopback mode

Observed Behavior

Messages from daily cron jobs were delayed by 3+ hours:

Event Timestamp (UTC)
FX100 cron job enqueued message 2026-02-20 04:26:36
Message actually delivered to Telegram 2026-02-20 07:48:25
Delay 3 hours 22 minutes

Logs

2026-02-20T07:47:59.941Z: Found 44 pending delivery entries — starting recovery
2026-02-20T07:48:25.166Z: Recovered delivery f085a33e... to telegram
2026-02-20T07:48:50.322Z: Recovered delivery cd138bd0... to telegram  
2026-02-20T07:48:50.326Z: Recovery time budget exceeded — 42 entries deferred to next restart

Root Cause

The delivery queue processor appears to only run during gateway startup/recovery, not as a continuous background process. Additionally, it has a strict time budget that only allowed processing 2 of 44 queued messages before deferring the rest.

Expected Behavior

  • Delivery queue should be processed continuously in the background
  • No multi-hour delays for message delivery
  • Or: Configurable delivery retry intervals

Workaround

Restarting the gateway forces delivery recovery:

openclaw gateway restart

Impact

  • Critical for cron-based notifications (daily reports, alerts)
  • 40+ messages can backlog for hours
  • User receives stale information

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions