Skip to content

Bug: a parked RAG indexing job has no recovery path and no signal #2986

Closed

Description

@Israeltheminer

What happens

A document whose indexing is parked behind the concurrency cap can sit in Queued forever. Every mechanism that exists to rescue a stuck row declines to act on it, and the UI presents the state as normal progress.

Observed on a self-hosted deployment: user uploads parked for 7 days, displayed as "Queued" the whole time, with no error anywhere and nothing the operator could click.

The three gates, all closed

1. The watchdog excludes parked rows by design — convex/file_metadata/internal_queries.ts:

// A parked `'queued'` row (concurrency cap) is waiting for a slot, not
// stuck — it has no scheduled action to time out. It's promoted by
// `promoteQueuedRagJobs`, never failed here.
if (status === 'queued' && row.ragParked === true) continue;

The reasoning holds only while something occupies a slot that will eventually transition. Nothing guarantees that.

2. promoteQueuedRagJobs runs only on a terminal transition — a job completing or failing. With no job running, nothing transitions, so nothing promotes. Deadlock.

3. Manual retry is refused — convex/documents/actions.ts:

if (ragStatus === 'running' || ragStatus === 'queued') {
  if (Date.now() - clock < IN_FLIGHT_STALE_MS) {   // 35 min
    return { success: false, error: 'Indexing is already in progress for this file.' };
  }
}

4. …and there is no button to call it anyway. app/features/projects/components/project-files-tab.tsx renders retry only for failed:

{failed && canEdit ? <IconButton icon={RotateCcw} … /> : null}

So a queued row offers no affordance at all, and for its first 35 minutes even the action behind it would refuse.

Net effect

Row age Watchdog Retry
< 35 min ignores (too young) refuses — "already in progress"
> 35 min, not parked sweeps ✓ works ✓
> 35 min, parked skips permanently would work — no UI to invoke it

The bottom row is unreachable from the product.

Suggested fix

  • Let the sweep treat a parked row past the stale window as a promotion candidate (not a failure), or run promoteQueuedRagJobs on the watchdog tick rather than only on terminal transitions.
  • Render the retry affordance for a queued row past the stale window.
  • Surface parked-ness. "Queued" reading identically for dispatched and parked indefinitely is what made this invisible for a week.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: highservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions