bug: stuck 'posting' status entries never get reprocessed #235

Open
opened 2026-06-29 14:21:03 +00:00 by jmiller · 1 comment
Owner

Description

If the PHP process dies while a post is in posting status (e.g., timeout, memory error, server restart), the post is stuck forever. The QueueProcessor::processQueue() method only queries for queued and failed statuses:

  • Queued posts: WHERE status = 'queued'
  • Retry posts: WHERE status = 'failed'

Posts with status = 'posting' are never re-processed and never show up as failed.

Fix

Add a stale-posting recovery step at the start of processQueue() that resets any posting entries older than a configurable timeout (e.g., 5 minutes) back to queued:

UPDATE #__mokosuitecross_posts 
SET status = 'queued', error_message = 'Reset from stuck posting state'
WHERE status = 'posting' 
AND modified < DATE_SUB(NOW(), INTERVAL 300 SECOND)

Impact

  • Severity: Medium -- posts can get permanently stuck if the process is interrupted during dispatch
  • Affected file: source/packages/com_mokosuitecross/src/Helper/QueueProcessor.php
## Description If the PHP process dies while a post is in `posting` status (e.g., timeout, memory error, server restart), the post is stuck forever. The `QueueProcessor::processQueue()` method only queries for `queued` and `failed` statuses: - Queued posts: `WHERE status = 'queued'` - Retry posts: `WHERE status = 'failed'` Posts with `status = 'posting'` are never re-processed and never show up as failed. ## Fix Add a stale-posting recovery step at the start of `processQueue()` that resets any `posting` entries older than a configurable timeout (e.g., 5 minutes) back to `queued`: ```sql UPDATE #__mokosuitecross_posts SET status = 'queued', error_message = 'Reset from stuck posting state' WHERE status = 'posting' AND modified < DATE_SUB(NOW(), INTERVAL 300 SECOND) ``` ## Impact - **Severity**: Medium -- posts can get permanently stuck if the process is interrupted during dispatch - **Affected file**: `source/packages/com_mokosuitecross/src/Helper/QueueProcessor.php`
Author
Owner

Branch created: feature/235-bug-stuck-posting-status-entries-never-g

git fetch origin
git checkout feature/235-bug-stuck-posting-status-entries-never-g
Branch created: [`feature/235-bug-stuck-posting-status-entries-never-g`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteCross/src/branch/feature/235-bug-stuck-posting-status-entries-never-g) ```bash git fetch origin git checkout feature/235-bug-stuck-posting-status-entries-never-g ```
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#235